// Leaving this here for future use const xml2json = require('xml2json'); const xml = ` `; const json = xml2json.toJson(xml, { object: true }); console.log(JSON.stringify(json, null, 2));