code: def parse(self, xml_data):
          
  
          # parse tree
          try:
              root = ET.fromstring(xml_data)
          except StdlibParseError as e:
              raise ParseError(str(e))
  
          self.origin = root.attrib['origin']
  
          for child in root:
              component = Component()
              component.parse(child)
              self.components[component.id] = component
docs: Parse XML data