docs: def load_dom(self, domtree, initialize=True):
          """
          Load manifest from DOM tree.
          
          If initialize is True (default), reset existing attributes first.
          
          """
          if domtree.nodeType == Node.DOCUMENT_NODE:
              rootElement = domtree.documentElement
          elif domtree.nodeType == Node.ELEMENT_NODE:
              rootElement = domtree
          else:
              raise InvalidManifestError("Invalid root element node type " + 
                                         str(rootElement.nodeType) + 
                                         " - has to be one of (DOCUMENT_NODE, "
                                         "ELEMENT_NODE)")
          allowed_names = ("assembly", "assemblyBinding", "configuration", 
                           "dependentAssembly")
          if rootElement.tagName not in allowed_names:
              raise InvalidManifestError(
                  "Invalid root element <%s> - has to be one of <%s>" % 
                  (rootElement.tagName, ">, <".join(allowed_names)))
          # logger.info("loading manifest metadata from element <%s>", rootElement.tagName)
          if rootElement.tagName == "configuration":
              for windows in rootElement.getCEByTN("windows"):
                  for assemblyBinding in windows.getCEByTN("assemblyBinding"):
                      self.load_dom(assemblyBinding, initialize)
          else:
              if initialize:
                  self.__init__()
              self.manifestType = rootElement.tagName
              self.manifestVersion = [int(i) 
                                      for i in 
                                      (rootElement.getA("manifestVersion") or 
                                       "1.0").split(".")]
              self.noInheritable = bool(rootElement.getFCEByTN("noInheritable"))
              self.noInherit = bool(rootElement.getFCEByTN("noInherit"))
              for assemblyIdentity in rootElement.getCEByTN("assemblyIdentity"):
                  self.type = assemblyIdentity.getA("type") or None
                  self.name = assemblyIdentity.getA("name") or None
                  self.language = assemblyIdentity.getA("language") or None
                  self.processorArchitecture = assemblyIdentity.getA(
                      "processorArchitecture") or None
                  version = assemblyIdentity.getA("version")
                  if version:
                      self.version = [int(i) for i in version.split(".")]
                  self.publicKeyToken = assemblyIdentity.getA("publicKeyToken") or None
              for publisherPolicy in rootElement.getCEByTN("publisherPolicy"):
                  self.applyPublisherPolicy = (publisherPolicy.getA("apply") or 
                                               "").lower() == "yes"
              for description in rootElement.getCEByTN("description"):
                  if description.firstChild:
                      self.description = description.firstChild.wholeText
              for trustInfo in rootElement.getCEByTN("trustInfo"):
                  for security in trustInfo.getCEByTN("security"):
                      for reqPriv in security.getCEByTN("requestedPrivileges"):
                          for reqExeLev in reqPriv.getCEByTN("requestedExecutionLevel"):
                              self.requestedExecutionLevel = reqExeLev.getA("level")
                              self.uiAccess = (reqExeLev.getA("uiAccess") or 
                                               "").lower() == "true"
              if rootElement.tagName == "assemblyBinding":
                  dependencies = [rootElement]
              else:
                  dependencies = rootElement.getCEByTN("dependency")
              for dependency in dependencies:
                  for dependentAssembly in dependency.getCEByTN(
                      "dependentAssembly"):
                      manifest = ManifestFromDOM(dependentAssembly)
                      if not manifest.name:
                          # invalid, skip
                          continue
                      manifest.optional = (dependency.getA("optional") or 
                                           "").lower() == "yes"
                      self.dependentAssemblies.append(manifest)
                      if self.filename:
                          # Enable search for private assembly by assigning bogus 
                          # filename (only the directory has to be correct)
                          self.dependentAssemblies[-1].filename = ":".join(
                              (self.filename, manifest.name))
              for bindingRedirect in rootElement.getCEByTN("bindingRedirect"):
                  oldVersion = [[int(i) for i in part.split(".")] 
                                for part in 
                                bindingRedirect.getA("oldVersion").split("-")]
                  newVersion = [int(i) 
                                for i in 
                                bindingRedirect.getA("newVersion").split(".")]
                  self.bindingRedirects.append((oldVersion, newVersion))
              for file_ in rootElement.getCEByTN("file"):
                  self.add_file(name=file_.getA("name"),
                                hashalg=file_.getA("hashalg"),
                                hash=file_.getA("hash"))