Wrapped XPath MP extraction in a function