input: Write a function to generate an XML document using Python which contains the given items as sub-elements under a root element named 'data'. The function should accept a list of items and output an XML file named 'data.xml'.
  assert generate_xml(['Item1', 'Item2', 'Item3'])==None
  assert generate_xml(['Product1', 'Product2', 'Product3'])==None
output: def generate_xml(items):
      from xml.etree.ElementTree import Element, SubElement, tostring
      root = Element('data')
      for item in items:
          SubElement(root, 'item').text = item
      with open('data.xml', 'wb') as f:
          f.write(tostring(root))