Javascript doesn't have any built-in knowledge of XPath. Calling an XPath processor is just like calling any other bit of software: you have to find a bit of software that does what you want, and then work out how to invoke it. The software that's available depends on the environment you are running in: if it's Javascript within the Internet Explorer browser (client-side) then your choices are much more limited than in some other environments.
So you need to be a bit more explicit that just saying you're running Javascript.
It's true though, there aren't very many XPath 2.0 processors around at the moment, and most of them are probably easiest to use from Java applications.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference