What is the order of the marshalled XML elements?
If you are using Castor’s default introspection to automatically map the objects into XML, then there is no guarantee on the order. It simply depends on the order in which the fields are returned to Castor using the Java reflection API. Note: If you use a mapping file Castor will generate the XML in the order in which the mapping file is specified.