Jaap has asked for the wisdom of the Perl Monks concerning the following question:

Wise Monks,

Using XML::Xpath on a 2 MB XML file generates a process that uses 90 MB of memory.

This is due to the fact that XML::XPath is built on top of XML::Parser, which builds a big nested hash structure of the entire XML file.

Would it be a good idea to build an XPath module that works directly on the XML?

It could first build an index of 1st level nodes, 2nd level nodes etc. Would this be a good path to follow?