const xml2js = require('xml2js'); const xml = 'bar'; xml2js.parseString(xml, (err, result) => { console.dir(result); { foo: 'bar' }