concept xml mapping in category .net

appears as: XML mapping, XML mapping, The XML mapping
NHibernate in Action

This is an excerpt from Manning's book NHibernate in Action.

We simulate the hierarchy of the XML mapping using the classes HomeAddressMapping and BillingAddressMapping, whose sole purpose is to provide the mapping. Note that NHibernate.Mapping.Attributes will automatically pick them because they belong to the User class. This solution isn’t elegant. You won’t have to deal with this kind of mapping often.

Whenever you think that XML mapping would be easier to use than attributes, you can use the [RawXml] attribute to integrate this XML inside your attributes. This is probably the case here; you can include the XML mapping of the components in listing 3.7 like this:

Note that, in few cases, it’s better to write XML mapping; for example, when dealing with a highly customized component or collection mapping. In these cases, you can use the attribute [RawXml] to insert this XML in your attribute mapping.