input: Write a function to generate an XML document using Python based on a list of items provided. The function should accept a list of item names, construct an XML Tree with each item as a sub-element of the root 'data' element, and write the XML Tree to a file named 'data.xml'. If the input list is empty, the function should create an empty 'data' element in the XML document.
  
  def generate_xml_document(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')
  
  # Test cases
  assert generate_xml_document(['Item1', 'Item2', 'Item3']) is None # Expected output: No exception means XML document is correctly written
  assert generate_xml_document([]) is None # Expected output: No exception means XML document with an empty 'data' element is correctly written
  assert generate_xml_document(['SingleItem']) is None # Expected output: No exception means XML document is correctly written for a single item
output: def generate_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')