Techniques are provided for mapping XML data and metadata from data in
relational databases. According to certain embodiments of the invention,
a mechanism is provided to allow the user to use a database query to
retrieve data form a relational database in the form of XML documents by
canonically mapping object relational data to XML data and canonically
mapping object relational schemas to XML-Schemas. The mechanism causes
the generation of XML-schema information for the XML documents.