Compatibility with new versions of lxml.

The API for XPath results changed slightly between lxml.
Added a wrapper to support both the old and new API.