code: function readXmlAsJson(filePath, simplify) {
    var xmlData;
    var parsedData;
    var parserOptions = {};
  
    if (simplify) {
      parserOptions = {
        attrValueProcessors: [xml2jsProcessors.parseNumbers, xml2jsProcessors.parseBooleans],
        explicitArray: false,
        mergeAttrs: true,
        explicitRoot: false
      };
    }
  
    var xmlParser = new xml2js.Parser(parserOptions);
    try {
      xmlData = fs.readFileSync(filePath);
      xmlParser.parseString(xmlData, function(err, data) {
        if (data) {
          parsedData = data;
        }
      });
    } catch (err) {}
  
    return parsedData;
  }
docs: Read data from the xml file as JSON object.
  
  @param {String} filePath - absolute path to xml file
  @param {Boolean} simplify - if set to true - cleanup resulting json
  @return {Object} JSON object with the contents of the xml file