If you're willing to use jQuery, there is:
http://www.fyneworks.com/jquery/xml-to-json/
$.get("http://jfcoder.com/test.xml.php", function(xml){
var json = $.xml2json(xml);
$('pre').html(JSON.stringify(json)); // To show result in the browser
});
Using:
<nums>
<num>00597</num>
<num>0059</num>
<num>5978</num>
<num>5.978</num>
</nums>
Outputs:
{"num":["00597","0059","5978","5.978"]}
http://jfcoder.com/test.php