1. A method comprising: storing a collection of XML documents in one or more base database structures managed by a database system; creating a table, separate from the one or more base database structures, that indexes the collection of XML documents, wherein the table includes a plurality of columns, wherein each column is associated with one or more criteria and contains values of nodes that are in the collection of XML documents and that satisfy the one or more criteria; and maintaining a domain index on a first column of the plurality of columns; wherein the domain index is not a B-tree index ordered according to values of nodes contained in the first column; wherein the first column is of a complex data type; and wherein the method is implemented by one or more computing devices.