1. A query engine for searching for an electronic document, comprising: (a) means for accepting a query; (b) means for compiling the query into query engine instructions, such instructions including tags and attributes instructions; (c) means for conducting a partial search for nodes based on tags and attributes; (d) means for conducting a predicate check on the nodes found by the partial search to ensure that the node conforms to the query; and (e) means for generating an output based on the predicate check.