A method of processing queries, e.g., XPath expressions, related to an XML
document includes generating a plurality of tokens based on the contents
of the XML document. At least one query expression is compiled to a first
plurality of query nodes defining a tree. A plurality of lookup tables
may be configured to relate each of the first plurality of query nodes by
a symbol. Each token is processed by looking up the query nodes indexed
by a symbol matching the token in one of the plurality of lookup tables,
marking each of the related query nodes, and indicating a match if each
of the first plurality of query nodes of the at least one query
expression is marked. A system for performing the method includes a
tokenizer, an expression compiler, and an engine module.