It looks as if you were encripting (in both ways) while reading every line. If that is the case, you should first read all the XML file and then pass it to the other translations.
That should be the way it works from CLI. Not all at the same time.
.{\('v')/}
_`(___)' __________________________
Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.