input: Write a function to parse an XML document and return a list of tag objects. Each tag object should contain the id attribute of the corresponding tag and a list of values from its sub-tags.
  assert parse_xml(
      "<xml><root><child1 id=\"1\"><subchild1 value=\"a\"></subchild1><subchild2 value=\"b\"></subchild2></child1><child2 id=\"2\"><subchild3 value=\"c\"></subchild3><subchild4 value=\"d\"></subchild4></child2></root></xml>"
  ) == [Tag('1', ['a', 'b']), Tag('2', ['c', 'd'])]
  assert parse_xml("<xml></xml>") == []
  assert parse_xml("<xml><root><child1 id=\"1\"><subchild1 value=\"a\"></subchild1></child1></root></xml>") == [Tag('1', ['a'])]
  assert parse_xml("<xml><root><child1 id=\"1\"></child1></root></xml>") == [Tag('1', [])]
  assert parse_xml("<xml><root><child1 id=\"1\"><subchild1 value=\"a\"></subchild1><subchild2 value=\"b\"></subchild2></child1><child2 id=\"2\"><subchild3 value=\"c\"></subchild3></child2></root></xml>") == [Tag('1', ['a', 'b']), Tag('2', ['c'])]
  
  def parse_xml(text):
      import xml.etree.ElementTree as ET
      class Tag:
          def __init__(self, tag_id):
              self.tag_id = tag_id
              self.values = []
          
          def add_value(self, value):
              self.values.append(value)
          
          def __eq__(self, other):
              return self.tag_id == other.tag_id and self.values == other.values
          
          def __repr__(self):
              return f"Tag('{self.tag_id}', {self.values})"
      
      tag_objects = []
  
      root = ET.fromstring(text)
      for child in root:
          tag = Tag(child.attrib["id"])
          for subchild in child:
              tag.add_value(subchild.attrib["value"])
          tag_objects.append(tag)
  
      return tag_objects
output: def parse_xml(text):
      import xml.etree.ElementTree as ET
      class Tag:
          def __init__(self, tag_id):
              self.tag_id = tag_id
              self.values = []
          
          def add_value(self, value):
              self.values.append(value)
          
          def __eq__(self, other):
              return self.tag_id == other.tag_id and self.values == other.values
          
          def __repr__(self):
              return f"Tag('{self.tag_id}', {self.values})"
      
      tag_objects = []
  
      root = ET.fromstring(text)
      for child in root:
          tag = Tag(child.attrib["id"])
          for subchild in child:
              tag.add_value(subchild.attrib["value"])
          tag_objects.append(tag)
  
      return tag_objects