Would it be possible to transform a large XML document into something on-disk that could be queried like a database by the XPath evaluator?
There's some fast databases that store prefix trees, which might be suitable for such a task actually (something like infinitydb). But building this database will basically take a while (it will require parsing the entire document). But i suppose if reading/querying is going to happen many times, its worth it?