input: Write a function to construct an XML document using Python which contains the items provided in a list. The XML document should have a root element named 'data' and each item in the list should be a sub-element named 'item'. If no items are provided, the XML document should be empty.
  assert construct_xml(['Item1', 'Item2', 'Item3'])
  assert construct_xml(['ItemA', 'ItemB'])
  assert construct_xml([])
  assert not construct_xml(None)
output: def construct_xml(items):
      if items is None:
          return ""
      xml = "<data>"
      for item in items:
          xml += f"<item>{item}</item>"
      xml += "</data>"
      return xml