In XSLT 2.0 you can use the replace() function and regular expressions.
For a 1.0 solution, see the str:replace function/template at
www.exslt.org
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference