input: Write a function to create an XML document using Python which contains the input list of items ['Item1', 'Item2', 'Item3']. The XML document should have a root element named 'data' and each item should be a sub-element named 'item' under the root. The function should write the XML tree to a file named 'data.xml'.
  import xml.etree.ElementTree as ET
  
  def create_xml_document():
      data = ET.Element('data')
      items = ['Item1', 'Item2', 'Item3']
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      tree = ET.ElementTree(data)
      tree.write('data.xml')
  
  assert create_xml_document() # No need for specific output as long as 'data.xml' is correctly created.
output: def create_xml_document():
      data = ET.Element('data')
      items = ['Item1', 'Item2', 'Item3']
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      tree = ET.ElementTree(data)
      tree.write('data.xml')