Markus Jais wrote: > but I still need a method to turn it into a string > because I need a string for my programm. And I have to > determine the length of the XML Document. write it to a memory file before writing it to the socket: http://www.python.org/doc/current/lib/module-StringIO.html import StringIO fp = StringIO.StringIO() Print(document, fp) s = fp.getvalue() </F>