code: 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;
    }
docs: Helper function that converts xml to json
  
  @param {xml} xml