EDIT: [it started with character replacement and I ended up with discovering string replacements with help of Dimitre Novatchev and Rol
Check out the XPath translate function: http://www.w3.org/TR/xpath/#function-translate
If it's not a single character, but a string you have to replace, it takes considerably more effort, and you need a template to recursively replace the string:
Edit:changed match="text()" to match="text()[not(../*)]", so that the input xml need not be a kind of "pretty print XML" .. (so as to remove unwanted replacements of space with "%20" string in such xml file)