code: def to_xml(self):
          
          root = ET.Element("scheme")
  
          ET.SubElement(root, "title").text = self.title
  
          # add a description subelement if it's defined
          if self.description is not None:
              ET.SubElement(root, "description").text = self.description
  
          # add all other subelements to this Scheme, represented by (tag, text)
          subelements = [
              ("use_external_validation", self.use_external_validation),
              ("use_single_instance", self.use_single_instance),
              ("streaming_mode", self.streaming_mode)
          ]
          for name, value in subelements:
              ET.SubElement(root, name).text = str(value).lower()
  
          endpoint = ET.SubElement(root, "endpoint")
  
          args = ET.SubElement(endpoint, "args")
  
          # add arguments as subelements to the <args> element
          for arg in self.arguments:
              arg.add_to_document(args)
  
          return root
docs: Creates an ``ET.Element`` representing self, then returns it.
  
          :returns root, an ``ET.Element`` representing this scheme.