Refactoring XML
Refactoring means updating the source code without changing the behaviour of the application. Refactoring helps you keep your code solid, dry, and easy to maintain. For more information, refer to Code refactoring.
Invoke an XML refactoring
Place the caret at the element to refactor, press Ctrl+Alt+Shift+T, and then select the required refactoring from the list.

If a dialog opens, fill in the fields as required and do one of the following:
Click OK to continue immediately or click Preview to have WebStorm show the usages of the selected tag or attribute in the Find tool window where you can mark usages as included in or excluded from refactoring.
Click Show XSLT... to view a fragment of the XSLT that is equivalent to the requested refactoring. This fragment can be used by XSLT processors to perform the requested refactoring on files outside your WebStorm project.
Rename a tag or an attribute
Place the caret within the tag or attribute to rename, press Ctrl+Alt+Shift+T, and then select Rename Tag or Rename Attribute from the list.
In the dialog that opens, type the new name of the tag or the attribute, select the scope in which you want to rename it, and click Refactor.

Merge tags
Merge two sequential and compatible XML tags into one larger tag with the same attributes as the original tags. The contents of the new tag will be created by appending the contents of the second tag to the contents of the first one. The tags to merge should have the same name and set of attributes.
Select the first tag to merge, press Alt+Enter, and then select Merge Tags from the list
Expand or collapse an empty tag
Place the caret at an empty tag and press Alt+Enter.
From the list, select the action to apply:
Expand Tag

Collapse Tag
