in reply to XML::Twig -vs- XML::XPath

XML::XPath indeed builds the DOM for the entire document in memory.

But if you need all of the power of XPath and the small memory footprint of XML::Twig, maybe there's hope: if XML::XPath and XML::Twig are both installed, you can use... XML::Twig::XPath, which essentially gives you XML::XPath's findnodes and findvalue in XML::Twig. It re-uses the XPath engine of XML::XPath, so you should not have any surprise with it. The Perl Review has an article about it, which should be online at some point.