input: Write a function to create an XML document in Python using the provided items. The function should return the XML document as a string. The input items (as a list) should be included as sub-elements under the root element 'data'.
  
  import xml.etree.ElementTree as ET
  
  def create_xml_document(items):
      # 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 the XML Tree
      tree = ET.ElementTree(data)
      
      # write the XML Tree to a string
      from io import BytesIO
      f = BytesIO()
      tree.write(f, encoding='utf-8', xml_declaration=True)
      return f.getvalue().decode('utf-8')
  
  assert create_xml_document(['Item1', 'Item2', 'Item3'])=='<data><item>Item1</item><item>Item2</item><item>Item3</item></data>'
  assert create_xml_document([])==''
  assert create_xml_document(['SingleItem'])=='<data><item>SingleItem</item></data>'
output: def create_xml_document(items):
      if not items:
          return ''
      data = ET.Element('data')
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
      tree = ET.ElementTree(data)
      from io import BytesIO
      f = BytesIO()
      tree.write(f, encoding='utf-8', xml_declaration=True)
      return f.getvalue().decode('utf-8')