If your XML file is small enough to keep all the data in memory, this is a simple easy way to implement a kind of a database; and you would enjoy the huge benefits of purely object-oriented database, no mapping code. If this is not the case, however, such approach would be very awkward, and I would strongly discourage it, recommend some RDBMS, which could be open-source and more or less light weight.
That said, if using XML-based in-memory object-oriented database, first thing you should require is total isolation of storage from database functionality. Your database should be some object graph of general shape (first of all, you should not assume it is a tree), and the storage should be 100% agnostic of data types. These primary goals are fully satisfied with
Data Contract:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
Please see my past answers where I advocate this wonderful approach:
How can I utilize XML File streamwriter and reader in my form application?[
^],
Creating property files...[
^].
Note that you won't need to work with XML manually. Your object graphs will be stored in full and later restored in memory. Circular dependencies (remember, I mentioned that the object graph is not required to be a tree), the approach will still perfectly work. Besides, you can easily evolve the database schema and provide backward compatibility with files created in earlier versions of your software.
If the main criterion (all-database-in-memory) cannot be guaranteed, I would say that the effort would not worth the effort, not at all. In this case, opt for RDMBS. Review this set:
http://en.wikipedia.org/wiki/List_of_relational_database_management_systems[
^],
http://en.wikipedia.org/wiki/List_of_object_database_management_systems[
^].
Good luck,
—SA