It boils down to JSON being schemaless. In XML the data type is implicitly defined by the tag, whereas in JSON you need to arbitrarily encode the datatype as a property and somehow differentiate between properties and child elements/objects.
<Foo1 name="foo1">
<Bar1 name="bar1"/>
</Foo1>
<Foo2 name="foo2">
<Bar2 name="bar2"/>
</Foo2>
[["Foo1", {"name" : "foo1"}, [
["Bar1", {"name" : "bar1" }]
],
["Foo2", {"name" : "foo2"}, [
["Bar2", {"name" : "bar2" }]
]]
I personally wouldn't do this, but the arbitrary encodings between the two samples are now equivalent.Plus, serialization to JSON in a dynamically-typed language is pretty much automagic compared to what you have to do with XML.