I still don't understand. What makes the XML version better than the JSON version? Why is creating XML like that a good solution, while creating JSON like that is not?
Plus, serialization to JSON in a dynamically-typed language is pretty much automagic compared to what you have to do with XML.