input: Write a function to construct an XML document using Python that contains the given data. The function should accept a list of items and generate an XML file named 'data.xml'. The root element should be 'data' and each item in the list should be a sub-element named 'item'. If the input list is empty, the XML document should still contain the root element 'data' with no sub-elements.
  
  def construct_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 construct_xml(['Item1', 'Item2', 'Item3']) is None
  assert construct_xml([]) is None
output: def construct_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')