in reply to How to save a XML File using XPath

To be honest, this looks like pretty much exactly what XML::Twig is written for. And, unlike findnodes_as_string, I'm pretty sure that mirod guarantees valid XML output ;-)

I may be biased, though, as my decision tree on XML is a bit sparse.