1. A computer-implemented method for representing and generating XML data, the method comprising: receiving a sparse representation document failing to satisfy a predefined schema, the sparse representation document comprising a plurality of sparsely-encoded XML elements comprising valid XML code portions that are limited to defining attribute values without corresponding tags; parsing the sparse representation document according to a predefined set of XML parsing rules, wherein the parsing generates a XML document having a valid XML structure according to the predefined schema; responsive to encountering a first sparsely-encoded XML element among the plurality of sparsely-encoded XML elements during the parsing, applying a mapping function to the first sparsely-encoded XML element, wherein the mapping function maps the first sparsely-encoded XML element to a first nested location in the XML document; and responsive to encountering a second sparsely-encoded XML element among the plurality of sparsely-encoded XML elements during the parsing, applying the mapping function to the second sparsely-encoded XML element, wherein the mapping function utilizes a heuristic to map the second sparsely-encoded XML element to a second nested location in the XML document, and wherein the heuristic handles at least one mapping by selecting a most recently encountered element.
2. The method of claim 1 , wherein the first nested location is a location within a subtree of the XML document that corresponds to a subtree of the sparse representation document in which the first sparsely-encoded XML element is located.