in reply to XML::XPath printToFile function?
Since everything is already in memory anyway with XML::XPath, I decided not to bother with a direct-to-filehandle output method. If you need that, try XML::LibXML, which does have that.