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
Video Tutorials
" oXygen XML Editor is the premier text editor for XML geeks, and an indispensable tool for O'Reilly's Production group. My team uses oXygen XML Editor for everything from simple XML editing to Schema validation and XSLT transformations. The digital production staff especially loves oXygen's built-in EPUB support, which eliminates a great deal of the grunt work that is usually entailed in editing EPUB files. The more we use oXygen, the more realize what a powerful tool it can be in digital and XML-based workflows."
Adam Witwer
Director of Content and Publishing Operations
O'Reilly Media