A method and apparatus for processing a query is provided. A query for a
set of Matching XML documents is received. A client may transmit the
query for a set of XML documents to the database server. The database
server transmits a request for the set of XML documents to a persistent
storage. The persistent storage uses an index, at least in part, to
obtain the set of XML documents sought by the query. The index stores a
first set of entries comprising information about the location of
elements, a second set of entries comprising information about element
attributes, and a third set of entries comprising information about
element values. In responding to a particular query, additional XML
documents that are not indexed by the index may also be checked to
determine if they correspond to the set of search criteria.