Code Here is some code that I’ve written that might be useful for others to use. XPath in JavaScript — an implementation of XPath 1.0 in JavaScript