XML mapping is undoubtedly the most common method of mapping entities with NHibernate. Basically, we create an XML document that contains all of the information about our classes and how it maps to our database tables.
These documents have several advantages:
They are text files, so they are small
They are very readable
They use a very small number of tags to describe the data
The two biggest complaints about XML mapping is the verbosity of the text and that it is not compiled.
We can handle some of the verbosity by limiting the amount of data we put into the document. There are a number of optional parameters that do not absolutely need to be mapped, but that provide additional information about the database that can be included. We'll discuss more about that in the Properties section.