in reply to XML - effective text node modification
You should definitely use a module. XML::Rules for example ... in the filter mode.
Jenda