A system and method for querying a stream of XML data in a single pass
using standard XQuery expressions. The system comprises: an expression
parser that receives a query and generates a parse tree; a SAX events API
that receives the stream of XML data and generates a stream of SAX
events; an evaluator that receives the parse tree and stream of SAX
events and buffers fragments from the stream of SAX events that meet an
evaluation criteria; and a tuple constructor that joins fragments to form
a set of tuple results that satisfies the query for the stream of XML
data.