input: Write a function to generate an XML document using Python which contains the given list of items. The function should create an XML document named 'data.xml' with a root element 'data' containing sub-elements 'item' for each item in the provided list.
  assert generate_xml(['Item1', 'Item2', 'Item3'])==None
  assert generate_xml(['ProductA', 'ProductB'])==None
  assert generate_xml([])==None
output: def generate_xml(items):
      import xml.etree.ElementTree as ET
      root = ET.Element("data")
      for item in items:
          ET.SubElement(root, "item").text = item
      tree = ET.ElementTree(root)
      tree.write("data.xml", encoding="utf-8", xml_declaration=True)