Basically, XML document is a collection of data. Though by collection of data, XML document is said as database in other sense a mere collection of data doesn't make much difference between the other files that store data. After all, all files contain data of some sort.
Still as a "database" format, XML has some advantages than other forms of data collection. XML in a database format is a self describing, portable, and can describe data in tree or graph structure. It is self-describing in the sense that the markup describes the structure and type names of the data, although not the semantics, it is portable means it uses Unicode, and it can describe data in tree or graph structures.
XML is treated as database because of its surrounding capabilities like: storage (XML documents), schemas (DTDs, XML Schemas, RELAX NG, and so on), query languages (XQuery, XPath, XQL, XML-QL, QUILT, etc.), programming interfaces (SAX, DOM, JDOM), like other databases. Hanson expresses that "XML data are extremely well-suited to hierarchical storage,"
But long winded nature and the slow accessibility to data due to parsing and text conversion are the drawbacks of this technology. Also on the minus side, it lacks many of the things found in real databases: efficient storage, indexes, security, transactions and data integrity, multi-user access, triggers, queries across multiple documents like RDBMS.
Reasons to adopt XML database:
According to John Cox, senior editor of Network World, there is need for the XML database as the network executives begin to experiment with web services. Users will be interacting with business partners and customers through web services.
On the other hand, suppose Web site is built from a number of prose-oriented XML documents. Not only to manage the site, also to provide a way for users to search its contents. Documents are likely to have a less regular structure and things such as entity usage are probably important because they are a fundamental part of how documents are structured. In this case, one needs a product like a native XML database or a content management system, which allow to preserve physical document structure, support document-level transactions, and execute queries in an XML query language.
And in case of object oriented applications, one needs a system that can store those objects in the database or serialize them as XML.
A good example of the type of "database" for which an XML document is suitable is an .ini file -- that is, a file that contains application configuration information. It is much easier to invent a small XML language and write a SAX application for interpreting that language than it is to write a parser for comma-delimited files. In addition, XML allows you to have nested entries, something that is harder to do in comma-delimited files.
However, this is hardly a database, since it is read and written linearly, and then only when the application is started and ended.
XML in web development:
XML is really helpful when sharing or transferring data between web and mobile, for some applications a database is a much better idea than XML, but not all. XML is good