examples/cordova1/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js
function writeJsonAsXml(file, content, options) {
    const xmlBuilder = new xml2js.Builder(options);
    const changedXmlData = xmlBuilder.buildObject(content);
    let isSaved = true;

    try {
      fs.writeFileSync(file, changedXmlData);
    } catch (err) {
      isSaved = false;
      throw new Error(`BRANCH SDK: Cannot write file ${file}`);
    }

    return isSaved;
  }
function writeJsonAsXml(file, content, options) {
    const xmlBuilder = new xml2js.Builder(options);
    const changedXmlData = xmlBuilder.buildObject(content);
    let isSaved = true;

    try {
      fs.writeFileSync(file, changedXmlData);
    } catch (err) {
      isSaved = false;
      throw new Error(`BRANCH SDK: Cannot write file ${file}`);
    }

    return isSaved;
  }
function writeJsonAsXml ( file , content , options ) { const xmlBuilder = new xml2js . Builder ( options ) ; const changedXmlData = xmlBuilder . buildObject ( content ) ; let isSaved = true ; try { fs . writeFileSync ( file , changedXmlData ) ; } catch ( err ) { isSaved = false ; throw new Error ( ` ${ file } ` ) ; } return isSaved ; }
write to xml file
write to xml file