examples/cordova1/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js
function readXmlAsJson(file) {
    let xmlData;
    let xmlParser;
    let parsedData;

    try {
      xmlData = fs.readFileSync(file);
      xmlParser = new xml2js.Parser();
      xmlParser.parseString(xmlData, (err, data) => {
        if (!err && data) {
          parsedData = data;
        }
      });
    } catch (err) {
      throw new Error(`BRANCH SDK: Cannot write file ${file}`);
    }

    return parsedData;
  }
function readXmlAsJson(file) {
    let xmlData;
    let xmlParser;
    let parsedData;

    try {
      xmlData = fs.readFileSync(file);
      xmlParser = new xml2js.Parser();
      xmlParser.parseString(xmlData, (err, data) => {
        if (!err && data) {
          parsedData = data;
        }
      });
    } catch (err) {
      throw new Error(`BRANCH SDK: Cannot write file ${file}`);
    }

    return parsedData;
  }
function readXmlAsJson ( file ) { let xmlData ; let xmlParser ; let parsedData ; try { xmlData = fs . readFileSync ( file ) ; xmlParser = new xml2js . Parser ( ) ; xmlParser . parseString ( xmlData , ( err , data ) => { if ( ! err && data ) { parsedData = data ; } } ) ; } catch ( err ) { throw new Error ( ` ${ file } ` ) ; } return parsedData ; }
read from xml file
read from xml file