input: from typing import List
  
  def parse_xml(text: str, Tag) -> List[Tag]:
      """Parse an XML document and return a list of tag objects.
      >>> 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(tag_id='1', values=['a', 'b']), Tag(tag_id='2', values=['c', 'd'])]
      """
output:     
      import xml.etree.ElementTree as ET
      root = ET.fromstring(text)
      tags = []
      for child in root.findall('.//child1') + root.findall('.//child2'):
          tag_id = child.get('id')
          values = [subchild.get('value') for subchild in child]
          tags.append(Tag(tag_id=tag_id, values=values))
      return tags
  