Q:

Generate XML from a class with JAVA

I asked this question before:
Generate XML from a class
I want to do this with Java.
Is it possible to do the same with Java via attributes?
or is there a framework i can use for this purpose as well.

A:

XStream will allow you to represent any class as an XML. You can check here for an example.

A:

JAXB could be what you want.  It's fairly common.  You just add some annotations to your properties and any instance of that class can be serialized/deserialized to XML.

