turn json to xml and xml to json
npm install json-xml
const {toXml, toJson} = require('json-xml');
const json = {
person: {
name: {
first: 'john',
last: 'doe'
}
}
};
const xml = toXml(json);
const jsonAgain = toJson(xml);
<person>
<name>
<first>
john
</first>
<last>
doe
</last>
</name>
</person>
{ person: { name: { first: 'john', last: 'doe' } } }