input: Write a function to create an XML document using Python which contains a list of items provided as input. If the input list is empty, the XML document should be empty as well. The function should return the string representation of the XML document.
  
  def create_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)
      from xml.dom import minidom
      return minidom.parseString(ET.tostring(data)).toprettyxml(indent="   ")
  
  assert create_xml_document(['Item1', 'Item2', 'Item3']) == '''<?xml version="1.0" ?>
  <data>
     <item>Item1</item>
     <item>Item2</item>
     <item>Item3</item>
  </data>
  '''
  assert create_xml_document([]) == '''<?xml version="1.0" ?>
  <data/>
  '''
output: def create_xml_document(items):
      import xml.etree.ElementTree as ET
      if not items:
          return '<?xml version="1.0" ?>\n<data/>'
      
      data = ET.Element('data')
      
      for item in items:
          item_element = ET.SubElement(data, 'item')
          item_element.text = item
          
      tree = ET.ElementTree(data)
      from xml.dom import minidom
      return minidom.parseString(ET.tostring(data)).toprettyxml(indent="   ")