1. A system to process an XML document associated with a schema, comprising: a streaming parser capable of generating a stream of discrete pieces of the XML document; and a matching component, running on one or more processors, capable of receiving the stream of discrete pieces of the XML document, wherein the stream of discrete pieces of the XML document contains one or more upstream discrete pieces of the XML document and a downstream discrete piece of the XML document; analyzing the schema associated with the XML document and using the schema to determine that the one or more upstream discrete pieces of the XML document are related to the downstream discrete piece of the XML document in the stream of discrete pieces of the XML document; keeping in memory said one or more upstream discrete pieces of the XML document before receiving the downstream discrete piece of the XML document from the stream; performing a match based on evaluating both the one or more upstream discrete pieces and the downstream discrete piece of the XML document after receiving the downstream discrete piece of the XML document; and passing the downstream discrete piece and the one or more upstream discrete pieces of the XML document to a user object for handling when the match is reached in the performing step.
7. The system according to claim 1 , further comprising: the matching component is further capable of representing the XML document in a hierarchical data structure with a plurality of nodes, wherein each node in the hierarchical data structure contains a portion of the XML document.