in reply to XML::XPath printToFile function?

As jeffa said, there is no such method.

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.