Currently I am using Castor framework to marshall the object into xml file it work greats
Writer writer = new FileWriter("D:/out.xml");
Marshaller.marshal(test, writer);
But now I am using javax.xml.bind to do the same thing.
Writer writer = new FileWriter("D:/out.xml");
JAXBContext context =
JAXBContext.newInstance(test.getClass());
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(test, writer);
Then I hits this error message :
unable to marshal type "package1.Testing" as an element because it is missing an @XmlRootElement annotation]