The sed you've posted will look for the exact string of characters in FROM and replace it with the entire string in TO. I think you want to do a one for one translation for each time characer X appears translate it to a matching character Y from the second set. If that is the case, try:
tr "[$FROM]" "[$TO]" <input.xml >output-file
I don't use translate hardly at all, but this seemed to work in the quick test that I just ran.