> JSON for lists, XML for trees
No. JSON is a recursive data structure that can represent trees as well.
It's easy to make a concise representation of DOM trees as JSON: http://m1el.github.io/jsonht.htm
I find it really sad that people don't know or consider s-expressions to represent trees.
(Department {:name "Scranton Branch"}
(Employee {:name "Michael Scott" :title "Regional Manager"}
(Department {:name "Sales"}
(Employee {:name "Dwight Schrute" :title "Ass. Regional Mgr"})
(Employee {:name "Jim Halpert" :title="Head of Sales"}
(Employee {:name "Andy Bernard" :title="Sales Rep"})
(Employee {:name "Phyllis Lapin" :title="Sales Rep"})))
(Employee {:name "Pam Beesly" :title "Office Administrator")))