A question came up on this list last month about getting the source for the FunctX library. The source has been up there for over a year, but it was separated by function, not all bundled into one module/stylesheet. For convenience, I have now posted a single module (in the case of XQuery) and stylesheet (XSLT) that you can access by clicking on the download link. I have also added a few new functions recently.
For XQuery 1.0:
For XSLT 2.0:
All of the example cases have been tested with Saxon 8.9.
Comments and contributions welcome...
Hope that helps,