The attached zip file has 2 items in it. One is a Java program that shows a template of how to create a custom XPath function (the function does a string replace using regular expressions.) The other is a TIBCO ActiveMatrix BusinessWorks? project (created in TIBCO Designer? 5.6) that uses the custom function.
There is some very basic documentation on how to use the template to create your own custom functions (it is pretty straightforward) and the project shows how to add the Java class file into a project to make the functions available. I wrote it as an example for someone (as an aside, the project also has a replace string process definition that is built only using native XPath as well just for comparison) and thought it might be of general interest. If more information or instruction is needed, let me know and I'll update the example.