Convert contents to attribute
The Convert Tag Contents to Attribute refactoring allows you to move textual contents of the tags with name of a selected tag into newly created attributes. This bulk transformation of tag contents to attributes is useful as XML schemas evolve.
Convert tag contents to attributes
Place the caret at the tag whose contents you want to convert to an attribute, press Ctrl+Alt+Shift+T, and then select Convert Tag Contents to Attribute from the list.
In the dialog that opens, type the name of the attribute to be created instead of the contents of the selected tag and specify the scope to convert the tag contents in.
With the Directory scope specified, select the Recursively checkbox to include sub-directories.
Select the Limit to files with DTD:... checkbox to limit the scope to the files with the same
DOCTYPEas specified for the current file.
To have extraneous spaces removed, select the Trim contents checkbox. Clear the checkbox to have all spaces preserved.

Invoke the refactoring:
Click OK to continue immediately or click Preview to have WebStorm show the usages of the selected tag 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.