I want to create a XML where blanks are replaced by
. But the Java-Transformer escapes the Ampersand, so that the output is  
As addon to forty-two's answer:
If, like me, you're trying the code in a non-patched Eclipse IDE, you're likely to see some weird A's appearing instead of the non-breaking space. This is because of the encoding of the console in Eclipse not matching Unicode (UTF-8).
Adding -Dfile.encoding=UTF-8
to your eclipse.ini should solve this.
Cheers, Wim