file.write harus string python

outFile = open('output.xml', 'wb')"b" for binary makes the difference.
Disgusted Duck