An XML database is a data persistence software system that allows data to be specified and sometimes stored in XML format. This data can be queried, processed, exported and returned to a calling system. XML databases are a taste of document-oriented databases that in turn are a category of NoSQL database.
Steve O'Connell gives a reason for using XML in databases: the increasingly common use of XML for transporting data, which means that "data is extracted from databases and put into XML documents and vice versa". It can be more efficient (in terms of conversion costs) and easier to store data in XML format. In content-based applications, the native XML database capability also minimizes the need for extracting or inputting metadata to support search and navigation.
XML enabled databases
XML-enabled databases typically offer one or more of the following approaches to storing XML within the traditional relational structure:
1. XML is stored in a CLOB (large character object)
2. XML is "shredded" in a series of tables based on a schema
3. XML is stored in a native XML type as defined in ISO Standard 9075-14
RDBMS that support the ISO XML type are:
1. IBM DB2 (pureXML)
2. Microsoft SQL Server
3. Oracle Database
4. PostgreSQL
Normally, an XML-enabled database is most suitable when most of the data is not XML. For data sets where most of the data is XML, a native XML database is more suitable.