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