Please see our samples at
www.software-friends.de (for german)
Select "KnowHow" in the menu, then you will find the
"Good News Project" which shows you how to write Enterprise Java Beans (EJBs) using EJB-Doclet with Container Managed Persistence (CMP) and Container Managed Relations (CMR).
Check XDoclet project at sf.net. It has examples. And look at JBoss documentation on this site.