input: Write a function that constructs an XML document using Python which contains the given items. The function should return the XML string. If the list of items is empty, the function should return an empty string.
  
  def construct_xml(items):
      if not items:
          return ""
      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
  
      # create ElementTree object
      tree = ET.ElementTree(data)
      
      # write the XML Tree to a string
      from io import StringIO
      f = StringIO()
      tree.write(f, encoding='unicode')
      return f.getvalue()
  
  assert construct_xml(['Item1', 'Item2', 'Item3']) == '<data><item>Item1</item><item>Item2</item><item>Item3</item></data>'
  assert construct_xml([]) == ''
output: def construct_xml(items):
      if not items:
          return ""
      import xml.etree.ElementTree as ET
      data = ET.Element('data')
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      from io import StringIO
      f = StringIO()
      ET.ElementTree(data).write(f, encoding='unicode')
      return f.getvalue()