An alternative for generating map files is xdoclet. I'm using it and I'm really happy, if you need any help on this I could give you some pointers.
having this in build.xml (with some tweaks) would do the job (get 1.2b3)
Code:
<target name="xdoclet.hibernatedoclet" description="run xdoclet to generate hibernate mapping files">
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask"
classpathref="lib.class.path"/>
<hibernatedoclet
destdir="${build.gen-src.dir}"
excludedtags="@version,@author,@todo"
force="${generated.forced}"
mergedir="${build.gen-src.dir}"
verbose="false">
<fileset dir="src">
<include name="**/hibernate/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet>