I'm looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn't find one. Have you seen any?
You could use the basic XPath plug-in for jQuery to get XPath query-ing functionality.
Also, you could consider reading this article on XPath XML processing (again with jQuery)
Take a look at http://dev.abiss.gr/sarissa/ project. They have migrated most of XML-related APIs to IE, as well as evaluate method on document object. And indeed, jQuery doesn't have an XPath processor, it has a very simple path selector like: /a/b/c only
Also, Backbase Ajax Framework has complete (and very thoroughly tested) XPath 1.0 implementation, and major part of XPath 2.0
I don't think it allows for ad-hoc queries, but you might take a look at Johann Burkard's XSLT jQuery plug-in for inspiration on how to implement XPath queries. I use it in my jQuery Reference Dashboard widget and it's really solid.
Google's AJAXSLT open source project fits well the stated requirements.
As their own description goes to say:
"AJAXSLT is an implementation of XSLT in JavaScript. Because XSLT uses XPath, it is also an implementation of XPath that can be used independently of XSLT. This implementation has the advantange that it makes XSLT uniformly available on more browsers than natively provide it, and that it can be extended to yet more browsers if necessary. AJAXSLT is interesting for developers who strive aggressively for cross browser compatibility of their advanced web applications. "
You could make use of the existing native DOM support of each browser. For this you would have to create your own wrapper, the reason is the differences between browser. You can take a look at http://dotnetcaffe.blogspot.com
Best regards