input: Write a function to construct an XML document using Python which takes a list of items as input and generates an XML file named 'data.xml'. Each item in the list should be represented as a sub-element under the root element 'data'. 
  
  def create_xml(items):
      import xml.etree.ElementTree as ET
  
      # creating the root element
      data = ET.Element('data')
  
      # loop over items
      for item in items:
          # creating sub elements
          item_element = ET.SubElement(data, 'item')
  
          # assign the value for the sub elements
          item_element.text = item
  
      # write the XML Tree
      tree = ET.ElementTree(data)
      tree.write('data.xml')
  
  # Assert test cases
  assert create_xml(['Item1', 'Item2', 'Item3'])==None
  assert create_xml(['Item4', 'Item5', 'Item6'])==None
  assert create_xml([])==None
output: def create_xml(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')