code: def make_soap_enveloped_saml_thingy(thingy, headers=None):
      
      soap_envelope = soapenv.Envelope()
  
      if headers:
          _header = soapenv.Header()
          _header.add_extension_elements(headers)
          soap_envelope.header = _header
  
      soap_envelope.body = soapenv.Body()
      soap_envelope.body.add_extension_element(thingy)
  
      return "%s" % soap_envelope
docs: Returns a soap envelope containing a SAML request
      as a text string.
  
      :param thingy: The SAML thingy
      :return: The SOAP envelope as a string