title: Easy way to migrate from JAXB to Castor?
body: <p>I have created a library which includes some 200 Java classes generated from an existing XSD with JAXB like this:</p>
  
  <pre><code>xjc -no-header -d schemas -b xsd/binding.xml xsd
  </code></pre>
  
  <p>Alas, JAXB is not supported on Android, and the general suggestion seems to be to use a different library. Castor seems to be a suitable alternative—especially as it offers conversion of .xsd into Java classes. However, doing so seems to be more complex than in Java, and I have no idea of how much the result differs from <code>xjc</code> output.</p>
  
  <p>My use case is unmarshaling and reading the unmarshaled data (changing data or marshaling are not needed). That is, there is a vast amount of code which relies on the resulting Java class schema, therefore any difference between <code>xjc</code>-generated classes and their Castor counterparts would mean a lot of refactoring.</p>
  
  <p>Is there a simple recipe on how to generate Java classes from .xsd in Castor and get a result that is as close as possible to what <code>xjc</code> produces?</p>