How does VTD-XML achieve random access?
By using Location Caches (LC), which are essentially hierarchical element directories. LCs are allocated on a per-level basis; i.e., the same LC indexes all elements of the same nesting depth. A LC entry is a 64-bit integer whose upper 32 bits is the index value of a VTD record of an element (starting tag), and whose lower 32 bits point to the LC entry corresponding to the first child element. The motivation is to stick with the winning strategy of VTD: constant token length and inherent persistence. The result: LC cost is about *10%* of the total VTD-XML processing cost.