old_contents: var xmldom = require('xmldom')
    , xpath = require('xpath')
    , saml2json = {}
    ;
  
  saml2json.parse = function(response){
  
    var xml = new Buffer(response, 'base64').toString('ascii')
      , doc = new xmldom.DOMParser().parseFromString(xml)
      , profile = {}, attributes
      ;
  
    attributes = xpath.select('//*[local-name() = "AttributeStatement"]/*', doc);
    attributes.forEach(function(attribute){
      var name = xpath.select('string(@Name)', attribute).toLowerCase();    
      profile[name] = xpath.select('string(*[local-name() = "AttributeValue"]/text())', attribute);
    });
  
    return profile;
    
  };
  
  module.exports = saml2json;
  
new_contents: // Saml2js
  // =======
  // A library for parsing SAML attributes
  // into a POJO (Plain Old JavaScript Object)
  
  // Require dependencies
  var xmldom    = require('xmldom'),
      xpath     = require('xpath'),
      _         = require('lodash'),
      profile   = {},
      attributes;
  
  
  // Saml2js
  // -------
  // Constructor function. Saves a copy
  // of the raw SAML you pass to it and 
  // a copy that's parsed into a JS object.
  //
  // `response` [String] - A SAML response string
  function Saml2js (response) {
    this.rawSaml    = response;
    this.parsedSaml = this.parse(response);
  }
  
  // Saml2js.parse
  // -------------
  // Private function.
  // Parses raw SAML assertion to JS object.
  Saml2js.prototype.parse = function(saml) {
    var xml       = new Buffer(saml, 'base64').toString('ascii'),
        doc       = new xmldom.DOMParser().parseFromString(xml);
  
    attributes = xpath.select('//*[local-name() = "AttributeStatement"]/*', doc);
    attributes.forEach(function(attribute){
      var name = xpath.select('string(@Name)', attribute);    
      profile[_.camelCase(name)] = xpath.select('string(*[local-name() = "AttributeValue"]/text())', attribute);
    });
  
    return profile;
  };
  
  
  // Saml2js.toJSON
  // --------------
  // Returns parsed SAML as a JSON string.
  // (Basically just an alias to `JSON.stringify()`).
  Saml2js.prototype.toJSON = function(obj) {
    return JSON.stringify(obj);
  };
  
  // Saml2js.get
  // -----------
  // Get the value of a SAML attribute by using its
  // original SAML attribute Name from the raw XML.
  //
  // `key` [String] - The attribute name as it appears in the raw SAML
  //
  // Example:
  //     // Given the following SAML/XML
  //     // <saml2:Attribute Name="First Name">
  //     //   <saml2:AttributeValue>John</saml2:AttributeValue>
  //     // </saml2:Attribute>
  //     console.log(parser.get('first name')); //=> John
  Saml2js.prototype.get = function(key) {
    return this.parsedSaml[_.camelCase(key)];
  };
  
  // Saml2js.toObject
  // ----------------
  // Returns the parsed SAML as a JS object.
  // This does not do any further processing, it
  // just returns the object's internal value
  // of `this.parsedSaml`.
  Saml2js.prototype.toObject = function() {
    return this.parsedSaml;
  };
  
  module.exports = Saml2js;
  
subject: Refactor and add additional methods to the saml2json library. This breaks compatibility with upstream and should now be considered a totally different module.