the issue that you have is because when you use xml2json it will encoding it inside it self and it will be double encoded. therefore you need to actually decode your file.
const convertToJson = (input)=>{
const json = parser.toJson(input);
const decode = JSON.parse(json);
return decode;
}
const result = convertToJson(“your xml file to be converted to JSON”)
console.log(result)
hopefully this helps you