input: Write a function that constructs an XML document using Python based on a list of items provided as input. The function should create a root element named 'data' and sub-elements named 'item' for each entry in the list. The XML document should be written to a file named 'data.xml'.
  assert construct_xml(['Item1', 'Item2', 'Item3'])==None
  assert construct_xml(['ItemA', 'ItemB'])==None
  assert construct_xml([])==None
output: def construct_xml(items):
      from xml.etree.ElementTree import Element, SubElement, tostring
      root = Element('data')
      for item in items:
          SubElement(root, 'item').text = item
      with open('data.xml', 'wb') as f:
          f.write(tostring(root))