An XML file cannot be a database in principle. But it can be used as a storage layer for some data model which is fully stored in memory during the lifetime of the application. In this case, the data layer along with the storage layer can really be used as a kind of a database.
It is really important to separate the data layer from the storage layer. For example, you need to perform the search in memory, not in XML, update memory, do transaction. XML should be only used when you really need to store the data on disk.
The best approach would be using Data Contract:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
If you do it, you can forget XML: everything is already done for you. The serializer simply store any object graph to memory and restore it in exact same way in memory from a file or a stream. I mean it: an object graph of arbitrary topology, not just a tree (it means, the graph is allowed to have circular references, which is critically important for relational model). This approach is the most robust and at the same time is the easiest to use. It is non-intrusive: you only define your data classes, the serialization is defined by the contract and is already done. Basically all you do is adding some attributes to data types and members, which does not limit or modify behavior of your types.
Please see my past answers where I advocate this approach:
How can I utilize XML File streamwriter and reader in my form application?[
^],
Creating property files...[
^].
—SA