lib/helpers.js
function toJson(xml) {
    var deferred = Q.defer();
    xml2js.parseString(xml, function(err, result) {
      if (err) {
        deferred.reject(new Error(err));
      } else {
        deferred.resolve(result);
      }
    });
    return deferred.promise;
  }
function toJson(xml) {
    var deferred = Q.defer();
    xml2js.parseString(xml, function(err, result) {
      if (err) {
        deferred.reject(new Error(err));
      } else {
        deferred.resolve(result);
      }
    });
    return deferred.promise;
  }
function toJson ( xml ) { var deferred = Q . defer ( ) ; xml2js . parseString ( xml , function ( err , result ) { if ( err ) { deferred . reject ( new Error ( err ) ) ; } else { deferred . resolve ( result ) ; } } ) ; return deferred . promise ; }
Helper function that converts xml to json

@param {xml} xml
Helper function that converts xml to json