No, you cannot add your own functions to XPath.
Depending on what you want to achieve you can find modules in the appstore with additional actions.