1. A method comprising the steps of: receiving a database statement that targets a table that contains a plurality of XML documents, wherein at least two of the XML documents in the table do not conform to the same XML schema; wherein the table comprises (a) a plurality of rows that each stores data for a different XML document and (b) a column that indicates, for each row, the schema to which the corresponding XML document conforms; in response to receiving the database statement, generating a plurality of execution plans for said database statement; wherein each execution plan of said plurality of execution plans corresponds to a different XML schema; wherein each execution plan of the plurality of execution plans is optimized based on the XML schema to which said execution plan corresponds; producing a plurality of intermediate results by using each execution plan, of the plurality of execution plans, to execute the database statement relative to only those XML documents, within the table, that conform to the XML schema associated with the execution plan; wherein using said each execution plan to execute the database statement includes, for each row of two or more rows of the table, using one or more values from the column of the table to determine the XML schema to which the corresponding XML document conforms; and generating a final result for the database statement based on the plurality of intermediate results; wherein the steps are performed on one or more computing devices.