http://qs321.pair.com?node_id=1211949


in reply to LiBXML: New markup while preserving earlier tags?

What immediately pops into my mind is that this is exactly the sort of thing that you can do with XSLT, which LibXML also fully supports. And in any case, no, you should not "circumvent" anything. Do your transformations within the DOM. Or, consider an alternate package such as XML::Twig which takes a fundamentally different approach to the problem.