All decent Web browsers implement an XPath engine... so let's use it!
The stable version is hosted on GitHub Pages, give it a try...