http://www.perlmonks.org?node_id=928079


in reply to Replacing XML Tag name with another

I usually use XML::XSH2:
open file ; rename Heading_1 /root/H1 ; rename Heading_2 /root/H2 ; save :b ;
Or, more elaborate:
rename :i { s/h/Heading_/ } /root/*[xsh:match(name(),'H[12]')] ;
Note that I use an underscore instead of a space, see mirod's Re: Replacing XML Tag name with another.