       'samlp:SessionIndex': session_index
   .end()
 
-create_logout_response = (issuer, status, in_response_to, destination) ->
+# Creates a LogoutResponse and returns it as a string of xml.
+create_logout_response = (issuer, in_response_to, destination, status='urn:oasis:names:tc:SAML:2.0:status:Success') ->
   xmlbuilder.create(
     {'samlp:LogoutResponse':
         '@Destination': destination
-        '@ID':  '_' + crypto.randomBytes(21).toString('hex')
+        '@ID': '_' + crypto.randomBytes(21).toString('hex')
         '@InResponseTo': in_response_to
         '@IssueInstant': (new Date()).toISOString()
         '@Version': '2.0'

        '@xmlns:saml': XMLNS.SAML
        'saml:Issuer': issuer
        'samlp:Status':
          'samlp:StatusCode': '@Value': 'urn:oasis:names:tc:SAML:2.0:status:Success'
    }, { headless: true }
    ).end()


        uri.query = sign_get_request deflated.toString('base64'), @private_key, relay_state
        cb null, url.format(uri)

    # Returns a redirect URL to confirm a successful logout.
    create_logout_response_url: (in_response_to, logout_url, cb) ->
      xml = create_logout_response @issuer, in_response_to, logout_url
      zlib.deflateRaw xml, (err, deflated) =>
        return cb err if err?
        uri = url.parse logout_url
        uri.query = sign_get_request deflated.toString('base64'), @private_key, undefined, true
        cb null, url.format(uri)

    # Returns XML metadata, used during initial SAML configuration
    create_metadata: (assert_endpoint) =>
