Update XPath functions to Saxon 9.5 API

Saxon 9.5 introduced API breaks, notably in the XPath extension function APIs. This PR adapts our own extension functions to Saxon 9.5.