Patch forthcoming.
Created attachment 13464 [details] proposed fix Please note that the imported tests were rewritten, since they used to be in Python, and had hooks into internal 4XPath implementation.
Comment on attachment 13464 [details] proposed fix r=me
Committed revision 19963.