def serializeDocument(self, stream=None, pretty=False):
return self._serialize(self.node.getroottree(), stream=stream, pretty=pretty,<EOL>xml_declaration=True)<EOL>
Serialize the contents of the entire XML document (including Doctype
        declaration, if there is one), with an XML declaration, for the current
        XmlObject to a stream.

        If no stream is specified, returns a string.
        :param stream: stream or other file-like object to write content to (optional)
        :param pretty: pretty-print the XML output; boolean, defaults to False
        :rtype: stream passed in or an instance of :class:`cStringIO.StringIO`