code: def toDom(self):
          
          namespaceURI = DOM.GetWSDLUri(self.version)
          self.document = DOM.createDocument(namespaceURI ,'wsdl:definitions')
  
          # Set up a couple prefixes for easy reading.
          child = DOM.getElement(self.document, None)
          child.setAttributeNS(None, 'targetNamespace', self.targetNamespace)
          child.setAttributeNS(XMLNS.BASE, 'xmlns:wsdl', namespaceURI)
          child.setAttributeNS(XMLNS.BASE, 'xmlns:xsd', 'http://www.w3.org/1999/XMLSchema')
          child.setAttributeNS(XMLNS.BASE, 'xmlns:soap', 'http://schemas.xmlsoap.org/wsdl/soap/')
          child.setAttributeNS(XMLNS.BASE, 'xmlns:tns', self.targetNamespace)
          
          if self.name:
              child.setAttributeNS(None, 'name', self.name)
  
          # wsdl:import
          for item in self.imports: 
              item.toDom()
          # wsdl:message
          for item in self.messages:
              item.toDom()
          # wsdl:portType
          for item in self.portTypes:
              item.toDom()
          # wsdl:binding
          for item in self.bindings:
              item.toDom()
          # wsdl:service
          for item in self.services:
              item.toDom()
docs: Generate a DOM representation of the WSDL instance.
          Not dealing with generating XML Schema, thus the targetNamespace
          of all XML Schema elements or types used by WSDL message parts 
          needs to be specified via import information items.