I think the XML format can be so diverse that it's impossible to write a code that could do this without a very strict defined XML format. Here is what I mean:
Koen Bok
26
Plutor Heidepeen
33
Would become
{'persons': [
{'name': 'Koen Bok', 'age': 26},
{'name': 'Plutor Heidepeen', 'age': 33}]
}
But what would this be:
See what I mean?
Edit: just found this article: http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html