Fix checked in -- both a modification to DTMManagerDefault which should do something more useful with your code as currently written, and a CachedXPathAPI class. Let me know how it works out...
Note that I have not deprecated XPathAPI. Its convenience and safety do balance its poor performance characteristics, so it may be worth retaining both it and the new solution. But I've updated its javadocs to mention the issue and the alternative.