code: def xml(self):
          
          tree = ElementTree.parse(METADATA_XML_TEMPLATE)
          root = tree.getroot()
  
          for name, prop in list(self.properties.items()):
              path = prop.xml_path
              elem = root.find(path, XML_NS)
              if elem is None:
                  # create elem
                  elem = insert_xml_element(root, path)
              elem.text = self.get_xml_value(name)
  
          return root
docs: xml representation of the metadata.
  
          :return: xml representation of the metadata
          :rtype: ElementTree.Element