1. A method comprising: receiving an input of data, the input data conforming to a query language used by a filter engine comprising two or more filter sub-engines, wherein at least one filter sub-engine is a general filter sub-engine and at least one filter sub-engine is an optimized filter sub-engine, and wherein the query language is based on eXtensible Markup Language (XML), wherein the query language is XPath; determining whether the input data conforms to a grammar associated with the optimized filter sub-engine, wherein the optimized filter sub-engine is configured to handle only a subset of the query language handled by the general filter sub-engine; in an event the determining indicates the input data conforms to the grammar associated with the optimized filter sub-engine; determining whether the input data can be processed by the optimized filter sub-engine, the determining comprising identifying if the input data comprises a subset of the query language; and directing the input data to the optimized filter sub-engine for processing; in an event the determining indicates that the input data cannot be processed by the optimized filter sub-engine; determining whether the input data can be processed by a second optimized filter sub-engine, wherein the second optimized filter sub-engine is configured to handle only a subset of the query language, and wherein the subset of the query language that the second optimized filter sub-engine is configured to handle excludes the subset of the query language that the first optimized filter sub-engine is configured to handle; and directing the input data to the second optimized filter sub-engine for processing; in an event the determining indicates that the input cannot be processed by the second optimized filter sub-engine, directing the input to the general filter sub-engine for processing, wherein the general filter sub-engine is configured to handle all aspects of the query language; and processing the input to derive a result.