code: def createDocument(self, nsuri, qname, doctype=None):
          
          impl = xml.dom.minidom.getDOMImplementation()
          return impl.createDocument(nsuri, qname, doctype)
docs: Create a new writable DOM document object.