
xml2json.js is a pure JavaScript library that converts XML strings into more human-readable JSON data.
How to use it:
Just download and load the xml2josn library into your document and done.
<script src="xml2json.js"></script>
Get the XML in a string.
var xmlInput = document.getElementById('xmlInput').value;Call the xml2json function
var jsonOutput = xml2json(xmlInput);
Beautify the JSON if needed.
var beautifiedJson = JSON.stringify(jsonOutput, undefined, 4);
Show the json output in a textarea
document.getElementById('jsonOutput').innerHTML = beautifiedJson;






