6. The apparatus of claim 5 , wherein the at least one XML element comprises an element tag and a body, and wherein the data indicative of the hierarchy of the elements comprises a string that excludes that at least the body of the at least one XML element.
5. An apparatus for processing XML documents received over a network, the apparatus comprising: a network interface configured to receive a packet of at least one XML document via at least one network, wherein each documents comprises a plurality of elements that define a hierarchy, said hierarchy containing context information for each element relative to a position within the XML document; a memory configured to have a cache to store data associated with each of the documents; at least one processor configured to: identify which of the XML documents is associated with the packet; identify at least one element of the XML document in the packet; identify a specified portion of the document, said specified portion comprising the at least one received element; generate a digest value based on the specified portion, wherein the digest value is indicative of the hierarchy of at least the specified portion of the XML document; derive speculative data by performing at least one function of the processing of the XML document; store, in the cache, indexed by the digest value, the derived speculative data, wherein the derived speculative data comprises data representing an XML structure of at least the specified portion of the XML document; compare a digest value of a specified portion of a subsequently received XML document to digest values stored in the cache; retrieve the data corresponding to the XML structure from the cache if the digest value of the specified portion of the subsequently received XML document matches a digest value stored in the cache; employ the data retrieved from the cache to process at least part of the subsequently XML document; and discard received elements of the XML file corresponding to the XML structure.