Call this template on the string you want to process:
Like this (it will work on the current node):
or like this, explicitly passing a parameter:
I think you are working with an XSLT 1.0 processor, whereas replace() is a function that has been introduced with XSLT/XPath 2.0.