There is also an interesting project called Otis. Below is the example *.otis.xml mapping taken from the documentation page:
<?xml version="1.0" encoding="utf-8" ?>
<otis-mapping xmlns="urn:otis-mapping-1.0">
<class name="Otis.Tests.UserDTO, Otis.Tests" source="Otis.Tests.Entity.User, Otis.Tests" >
<member name="Id" />
<member name="Age" />
<member name="UserName" expression="$UserName.ToUpper()" nullValue="[unknown]" />
<member name="FullName" expression="[$FirstName + ' ' + $LastName]" />
<member name="ProjectCount" expression="$Projects.Count" />
<member name="Title" expression="$Gender" >
<map from="Gender.Male" to="Mr." /> <!-- projections -->
<map from="Gender.Female" to="Mrs." />
</member>
<member name="Birthday" expression="$BirthDate" format="Born on {0:D}"/>
<member name="ProjectCount" expression="$Projects.Count" />
<member name="AvgTaskDuration" expression="avg:$Projects/Tasks/Duration" />
<member name="MaxTaskDuration" expression="max:$Projects/Tasks/Duration" />
</class>
To read the mapping files from the assembly:
// configure the new Configuration object using metadata of types in the current assembly
Configuration cfg = new Configuration(); // instantiate a new Configuration, one per application is needed
cfg.AddAssembly(Assembly.GetExecutingAssembly()); // initialize it
Hmm, where have I seen it before? ;)