input: Write a function to parse an XML document and return a list of tag objects. The function should return a list of Tag objects where each Tag object contains an id from the corresponding tag's attributes and a list of values from the sub-tags' attributes. Ensure that the function handles the provided XML structure correctly.
  
  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>""")[0].tag_id=="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>
        <subchild4 value="d"></subchild4>
      </child2>
    </root>
  </xml>""")[0].values==['a', 'b']
  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>""")[1].tag_id=="2"
  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>""")[1].values==['c', 'd']
output: 
  def parse_xml(xml_str):
      from xml.etree import ElementTree as ET
      root = ET.fromstring(xml_str)
      tags = []
  
      class Tag:
          def __init__(self, tag_id, values):
              self.tag_id = tag_id
              self.values = values
  
      for child in root.findall('.//root/*'):
          tag_id = child.attrib['id']
          values = [subchild.attrib['value'] for subchild in child]
          tags.append(Tag(tag_id, values))
  
      return tags
  