code: def get_status(self, status_value, message=None):
          
          status = etree.Element('Status')
          status_code = etree.SubElement(status, 'StatusCode')
          status_code.set('Value', 'samlp:' + status_value)
          if message:
              status_message = etree.SubElement(status, 'StatusMessage')
              status_message.text = message
          return status
docs: Build a Status XML block for a SAML 1.1 Response.