This small and fast utility converts an XML file fetched through $.ajax to a JavaScript Object, completely eliminating a need to use DOM Tree walking to extract data. All attributes and values are accessible using dot (.) notation. Besides simplifying the way you access data you can also sort nodes prior further processing. This component can be easily used to write a SOAP or RSS client.
How JSON object is assembled? - this utility is a recursive walker that starts off at the root of your document and creates a new object for each node, and new field for each node attribute. Whenever a a tree walker encounters a text node or a CDATA within your node, it assigns it’s value to a .Text field of that js object (object that represents a node). Ex: < node1>Hello World would be stored at node1.Text