code: def writeXML(self, e):
          
          self.writeType(TYPE_XML)
  
          data = xml.tostring(e)
  
          if isinstance(data, unicode):
              data = data.encode('utf-8')
  
          self.stream.write_ulong(len(data))
          self.stream.write(data)
docs: Writes an XML instance.