There are several good open source XPath engines for Java, most distributed as part of XSLT processors. They include the following:
Saxon 6.5.x [http://saxon.sourceforge.net]
A very fast XSLT processor written by Michael Kay and distributed under the Mozilla Public License 1.0. This is the processor I used to generate this book. (Saxon 7.x is also available, but it's an incomplete experimental implementation of XPath 2.0, which itself likely won't be finished until sometime in 2003. Both the Saxon 6.5 API and XPath 1.0 are much more stable and bug-free.)
An XSLT processor used by several Apache XML projects including Cocoon. It is of course distributed under the Apache license. If you happen ...