input: Write a function to parse an XML document and return a list of tag objects. Each tag object should contain the tag id and a list of values from its subchildren. If the XML is empty or invalid, return an empty list.
  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><root></root></xml>')==[]
  assert parse_xml('')==[]
  assert parse_xml('<invalidxml></invalidxml>')==[]
output: def parse_xml(xml_str):
      from xml.etree import ElementTree as ET
      try:
          root = ET.fromstring(xml_str)
          if root is None:
              return []
          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, values))
          return tags
      except ET.ParseError:
          return []