docs: def todom(self):
          """ Return the manifest as DOM tree """
          doc = Document()
          docE = doc.cE(self.manifestType)
          if self.manifestType == "assemblyBinding":
              cfg = doc.cE("configuration")
              win = doc.cE("windows")
              win.aChild(docE)
              cfg.aChild(win)
              doc.aChild(cfg)
          else:
              doc.aChild(docE)
          if self.manifestType != "dependentAssembly":
              docE.setA("xmlns", "urn:schemas-microsoft-com:asm.v1")
              if self.manifestType != "assemblyBinding":
                  docE.setA("manifestVersion", 
                            ".".join([str(i) for i in self.manifestVersion]))
          if self.noInheritable:
              docE.aChild(doc.cE("noInheritable"))
          if self.noInherit:
              docE.aChild(doc.cE("noInherit"))
          aId = doc.cE("assemblyIdentity")
          if self.type:
              aId.setAttribute("type", self.type)
          if self.name:
              aId.setAttribute("name", self.name)
          if self.language:
              aId.setAttribute("language", self.language)
          if self.processorArchitecture:
              aId.setAttribute("processorArchitecture", 
                               self.processorArchitecture)
          if self.version:
              aId.setAttribute("version", 
                               ".".join([str(i) for i in self.version]))
          if self.publicKeyToken:
              aId.setAttribute("publicKeyToken", self.publicKeyToken)
          if aId.hasAttributes():
              docE.aChild(aId)
          else:
              aId.unlink()
          if self.applyPublisherPolicy != None:
              ppE = doc.cE("publisherPolicy")
              if self.applyPublisherPolicy:
                  ppE.setA("apply", "yes")
              else:
                  ppE.setA("apply", "no")
              docE.aChild(ppE)
          if self.description:
              descE = doc.cE("description")
              descE.aChild(doc.cT(self.description))
              docE.aChild(descE)
          if self.requestedExecutionLevel in ("asInvoker", "highestAvailable", 
                                              "requireAdministrator"):
              tE = doc.cE("trustInfo")
              tE.setA("xmlns", "urn:schemas-microsoft-com:asm.v3")
              sE = doc.cE("security")
              rpE = doc.cE("requestedPrivileges")
              relE = doc.cE("requestedExecutionLevel")
              relE.setA("level", self.requestedExecutionLevel)
              if self.uiAccess:
                  relE.setA("uiAccess", "true")
              else:
                  relE.setA("uiAccess", "false")
              rpE.aChild(relE)
              sE.aChild(rpE)
              tE.aChild(sE)
              docE.aChild(tE)
          if self.dependentAssemblies:
              for assembly in self.dependentAssemblies:
                  if self.manifestType != "assemblyBinding":
                      dE = doc.cE("dependency")
                      if assembly.optional:
                          dE.setAttribute("optional", "yes")
                  daE = doc.cE("dependentAssembly")
                  adom = assembly.todom()
                  for child in adom.documentElement.childNodes:
                      daE.aChild(child.cloneNode(False))
                  adom.unlink()
                  if self.manifestType != "assemblyBinding":
                      dE.aChild(daE)
                      docE.aChild(dE)
                  else:
                      docE.aChild(daE)
          if self.bindingRedirects:
              for bindingRedirect in self.bindingRedirects:
                  brE = doc.cE("bindingRedirect")
                  brE.setAttribute("oldVersion", 
                                   "-".join([".".join([str(i) 
                                                       for i in 
                                                       part]) 
                                             for part in 
                                             bindingRedirect[0]]))
                  brE.setAttribute("newVersion", 
                                   ".".join([str(i) for i in bindingRedirect[1]]))
                  docE.aChild(brE)
          if self.files:
              for file_ in self.files:
                  fE = doc.cE("file")
                  for attr in ("name", "hashalg", "hash"):
                      val = getattr(file_, attr)
                      if val:
                          fE.setA(attr, val)
                  docE.aChild(fE)
          return doc