input: def parse_xml(text: str) -> List['Tag']:
      """ Parses an XML document and returns a list of tag objects. Each tag object contains
      the tag's id and a list of its subtags' values.
      >>> 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(tag_id='1', values=['a', 'b']), Tag(tag_id='2', values=['c', 'd'])]
      """
  
  class Tag:
      def __init__(self, tag_id):
          self.tag_id = tag_id
          self.values = []
      
      def add_value(self, value):
          self.values.append(value)
      
      def __repr__(self):
          return f'Tag(tag_id={self.tag_id}, values={self.values})'
output:     from xml.etree import ElementTree as ET
  
      root = ET.fromstring(text)
      tags = []
  
      def parse_tag(element):
          tag = Tag(element.attrib['id'])
          for sub_element in element:
              tag.add_value(sub_element.attrib['value'])
          return tag
  
      for child in root.findall('.//child1'):
          tags.append(parse_tag(child))
  
      for child in root.findall('.//child2'):
          tags.append(parse_tag(child))
  
      return tags