EntityDescriptor is the base of metadata, so thats what you start with, just add in the elements you whant by adding java object with usually the same name. Then you marshall the entitydescriptor and print xml.
I talk you through it on this blog page.
In my book, A Guide to OpenSAML, I have a lot of information and examples on OpenSAML.
EDIT New edition of the book is out, covering OpenSAML V3