input: Write a function to create an XML document using Python which takes a list of items and constructs an XML document with each item as a sub-element under the root element 'data'. Write the resulting XML tree to a file named 'data.xml'.
  
  def create_xml_document(items):
      import xml.etree.ElementTree as ET
      data = ET.Element('data')
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      tree = ET.ElementTree(data)
      tree.write('data.xml')
  
  assert not create_xml_document(['Item1', 'Item2', 'Item3']) == None
  assert not create_xml_document([]) == None
  assert not create_xml_document(['SingleItem']) == None
output: def create_xml_document(items):
      import xml.etree.ElementTree as ET
      data = ET.Element('data')
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      tree = ET.ElementTree(data)
      tree.write('data.xml')