code: def parse(cls, root):
          
          if root.tag != utils.lxmlns("mets") + "mdWrap":
              raise exceptions.ParseError(
                  "MDWrap can only parse mdWrap elements with METS namespace."
              )
          mdtype = root.get("MDTYPE")
          if not mdtype:
              raise exceptions.ParseError("mdWrap must have a MDTYPE")
          othermdtype = root.get("OTHERMDTYPE")
          document = root.xpath("mets:xmlData/*", namespaces=utils.NAMESPACES)
          if len(document) == 0:
              raise exceptions.ParseError(
                  "All mdWrap/xmlData elements must have at least one child; this"
                  " one has none"
              )
          elif len(document) == 1:
              document = document[0]
  
          # Create a copy, so that the element is not moved by duplicate references.
          document = copy.deepcopy(document)
  
          return cls(document, mdtype, othermdtype)
docs: Create a new MDWrap by parsing root.
  
          :param root: Element or ElementTree to be parsed into a MDWrap.
          :raises exceptions.ParseError: If mdWrap does not contain MDTYPE
          :raises exceptions.ParseError: If xmlData contains no children