27. A computer readable storage medium comprising instructions which, when executed by one or more processors, cause the one of more processors to perform: receiving a logical description that references an XML datatype, wherein a database system supports multiple database representations for the XML datatype; receiving one or more Data Manipulation Language (DML) queries that reference the XML datatype; evaluating the one or more DML queries, wherein evaluating one or more DML queries comprises: determining a plurality of database representations that the database system supports for the XML datatype; re-writing the one or more DML queries based on the plurality of database representations; performing a cost analysis of the re-written DML queries; based on the logical description and said evaluating said one or more DML queries, determining a database representation for the XML datatype; wherein said database representation includes one or more base structures that are used to store data for the XML datatype.
27. A computer readable storage medium comprising instructions which, when executed by one or more processors, cause the one of more processors to perform: receiving a logical description that references an XML datatype, wherein a database system supports multiple database representations for the XML datatype; receiving one or more Data Manipulation Language (DML) queries that reference the XML datatype; evaluating the one or more DML queries, wherein evaluating one or more DML queries comprises: determining a plurality of database representations that the database system supports for the XML datatype; re-writing the one or more DML queries based on the plurality of database representations; performing a cost analysis of the re-written DML queries; based on the logical description and said evaluating said one or more DML queries, determining a database representation for the XML datatype; wherein said database representation includes one or more base structures that are used to store data for the XML datatype. 28. The computer readable storage medium of claim 27 , further including instructions for performing: based on determining a database representation for the XML datatype, generating Data Description Language (DDL) code to execute to create one or more base structures for the XML datatype.