XPathContext#evalute use the xmlXPathRegisterFuncLookup function to register a lookup function, unfortunately namespace is not used during the lookup phase.
To fix it:
Node#extract_params should allow a hash as handler (as for XSLT#parse)
lookup should use the ns_uri parameter