docs: def fromxml(node, file=None):
          """Read metadata from XML. Static method returning an CLAMMetaData instance (or rather; the appropriate subclass of CLAMMetaData) from the given XML description. Node can be a string or an etree._Element."""
          if not isinstance(node,ElementTree._Element): #pylint: disable=protected-access
              node = parsexmlstring(node)
          if node.tag == 'CLAMMetaData':
              dataformat = node.attrib['format']
  
              formatclass = None
              for C in CUSTOM_FORMATS: #CUSTOM_FORMATS will be injected by clamservice.py
                  if C.__name__ == dataformat:
                      formatclass = C
                      break
              if formatclass is None and dataformat in vars(clam.common.formats) and issubclass(vars(clam.common.formats)[dataformat], CLAMMetaData):
                  formatclass = vars(clam.common.formats)[dataformat]
              if formatclass is None:
                  raise Exception("Format class " + dataformat + " not found!")
  
              data = {}
              if 'inputtemplate' in node.attrib:
                  data['inputtemplate'] = node.attrib['inputtemplate']
              if 'inputtemplatelabel' in node.attrib:
                  data['inputtemplatelabel'] = node.attrib['inputtemplatelabel']
  
  
  
              for subnode in node:
                  if subnode.tag == 'meta':
                      key = subnode.attrib['id']
                      value = subnode.text
                      data[key] = value
                  elif subnode.tag == 'provenance':
                      data['provenance'] = CLAMProvenanceData.fromxml(subnode)
              return formatclass(file, **data)
          else:
              raise Exception("Invalid CLAM Metadata!")