in reply to How to save a XML File using XPath
XML::XPath doesn't really have have a mechanism for getting the whole document as a string so you have to do something like:
and then you can print that to a file in the usual way.my $document = ($foo->findnodes('/'))[0]->toString();
Update: derby, is of course correct. The (unfortunately undocumented) getNodesAsXML() does return $self->findnodes_as_string('/'); if no path is provided, however findnodes_as_string() comes with the caveat: "The result is not guaranteed to be valid XML though.", which may or may not also be true of my version.
/J\
|
|---|