Compilation fix for libxml2 < 2.9.1

Older versions didn't have xmlXPathNodeEval() function.
Prevent using xpath_context with a node from another document.

This check is contained in libxml2 too.
Throw an exception with explanatory message.
Fix misc Visual C++ warnings.