Extract XML Schema from a Database Structure

You can do this using the database import feature (where beside the raw data you can get a related schema based on database definition) or using the Tools menu entry "Convert DB Structure to XML Schema".

Using the later one, you can select the tables, establish criteria for the table fields (such as generate it as element, attribute, skipped, or set a new presentation name), and select between two types of database schema representation: flat (based on an ISO-ANSI SQL/XML draft) and hierarchical.

The Convert Database to Schema Dialog

Database relationships and constraints (e.g. primary and foreign keys) are converted into proper W3C schema constraints (such as identity constraints, key and keyref entries).

The way the database types are mapped to W3C XML Schema types is presented through annotations in the resulting schema. Other options to control the conversion are available in the Preferences as shown below:

The Database/Import Dialog