WebStorm 2026.1 Help

Unwrap tag

The Unwrap Tag refactoring allows you to remove all tags with the name of the selected tag and replace them with their contents, including sub-tags. This bulk unwrapping of tags may be useful as XML schemas evolve.

In the example below, the Unwrap Tag refactoring is invoked from the <alternative-titles></alternative-titles> tag. As a result, all the occurrences of the <alternative-titles></alternative-titles> tag are removed and replaced with <title></title> tags.

<imdb> <movie title="Color Me Hope" year="2014"> <alternative-titles> <title region="US">Color Me Hope</title> <title region="UK">Colour Me Hope</title> </alternative-titles> <genres...> <crew...> <cast...> </movie> <movie title="Riding the Long White Cloud" year="2009" runtime="44"> <alternative-titles> <title region="US">Riding the Long White Cloud</title> </alternative-titles> <genres...> <crew...> <cast...> </movie> <movie title="The Foxy Hunter" year="1937" runtime="8"> <alternative-titles> <title region="NO">Bettys hund og pelskraven</title> <title region="UK">The Foxy Hunter</title> <title region="BR">O Caçador de Raposas</title> <title region="US">The Foxy Hunter</title> </alternative-titles> <genres...> <crew...> <cast...> <ratings votes="86" average="5.9"> </movie> </imdb>
<imdb> <movie title="Color Me Hope" year="2014"> <title region="US">Color Me Hope</title> <title region="UK">Colour Me Hope</title> <genres...> <crew...> <cast...> </movie> <movie title="Riding the Long White Cloud" year="2009" runtime="44"> <title region="US">Riding the Long White Cloud</title> <genres...> <crew...> <cast...> </movie> <movie title="The Foxy Hunter" year="1937" runtime="8"> <title region="NO">Bettys hund og pelskraven</title> <title region="UK">The Foxy Hunter</title> <title region="BR">O Caçador de Raposas</title> <title region="US">The Foxy Hunter</title> <genres...> <crew...> <cast...> <ratings votes="86" average="5.9"> </movie> </imdb>

Unwrap a tag

  1. Place the caret at the tag to unwrap, press Ctrl+Alt+Shift+T, and then select Unwrap Tag from the list.

  2. In the dialog that opens, specify the scope to unwrap the tag 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 DOCTYPE as specified for the current file.

    Unwrapping a tag
  3. 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.

30 January 2026