input: Write a function to generate an XML document using Python with the provided list of items. The function should create an XML tree with a root element named 'data' and sub-elements named 'item' for each item in the list. Save the XML tree to a file named 'data.xml'.
  assert generate_xml(['Item1', 'Item2', 'Item3'])==None
  assert generate_xml(['Apple', 'Banana', 'Orange'])==None
  assert generate_xml([])==None
output: def generate_xml(items):
      from xml.etree.ElementTree import Element, SubElement, ElementTree
  
      root = Element('data')
      for item in items:
          sub_element = SubElement(root, 'item')
          sub_element.text = item
  
      tree = ElementTree(root)
      tree.write('data.xml', encoding='utf-8', xml_declaration=True)