Bugfix: There was a problem found encoding the ° symbol. Fixed by replacing PrintWriter by OutputStreamWriter/FileOutputStream and specifying UTF-8.

A reply Steve W. Jackson gave somewhere online pointed me in the right direction:

I've encountered this problem myself. The solution was to use something
 besides a FileWriter to output your new XML document, since you need to
 encode both the XML data and the data written to an external file.

 Your OutputFormat object specifies that the XML gets UTF-8 encoding, but
 the FileWriter will use your system's default encoding. What I use now
 is an OutputStreamWriter with its constructor taking an OutputStream (I
 use a FileOutputStream) and a String naming the encoding. That solved
 the problem for me.

 Hope this helps.

 = Steve =
 --
 Steve W. Jackson