This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
If you have static XML document that is not going to change, its ok to use that.Using XML as database is not a good/preferred option because of following obvious reasons:
1- Inefficient for dynamic documents. 2- More disk space is required to store XML documents, because of redundancy. 3- It is not practical for insert/update/delete operation as you need to load entire XML document into memory (eg. using DOM) and modify its nodes as required. After that you need marshal that document again into disk. It is resource intensive and time consuming task. 4- You won't get benefits of relational database.
Generally XML is generated lookup into database or any data source on the fly as per required depending upon user request for example. [ November 05, 2008: Message edited by: Chandra Bhatt ]
Here's a link to the Wikipedia article about XML databases. If you read it, you will see that the strategy of storing all your data in a single monster XML document isn't described there. I think that's because (as already mentioned by earlier posters) it really isn't a very good idea at all.
But your task is just to "use XML as database". That doesn't necessarily mean one monster XML document anyway. It could mean something sensible. It could mean a lot of things. Perhaps you should clarify the requirements before you start designing (or buying).