It is possible to do string manipulation like replace etc in XSLT as well. Javascript has str.replace right? So in XSLT you can do this by creating templates and by doing call-template.
Follow this link for complete info and source code
http://www.dpawson.co.uk/xsl/sect2/StringReplace.html