title: JAXB Annotations
body: <p>I need a little help with JAXB Annotations and I couldn't find good doc's helping me figure this out.</p>
  
  <p>I have a class that I want to marshal into XML. My Class looks like this:</p>
  
  <pre><code>@XmlRootElement(name="car")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(propOrder = {
      "vid",
      "make",
      "model",
      "recalls",
      "engSpec"
  })
  
  public class Car {
      @XmlElement(name="vid", required=true)
      private String vid;
      @XmlElement(name="make", required=true)
      private String make;
      @XmlElement(name="model", required=true)
      private String model;
      @XmlElement(name="recalls", required=true)
      private ArrayList&lt;Recall&gt; recalls;
      @XmlElement(name="engSpec", required=true)
      private EngSpec engSpec;
  ...
  </code></pre>
  
  <p>And the recall class looks like this:</p>
  
  <pre><code>@XmlRootElement(name = "recall")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(propOrder = {
          "type",
          "date"
  })
  public class Recall {
      @XmlElement(name="type", required=true)
      private String type;
      @XmlElement(name="date", required=true)
      private String date;
  ...
  </code></pre>
  
  <p>So it produces this XML output:</p>
  
  <pre><code>&lt;car&gt;
   &lt;vid&gt;vid&lt;/vid&gt;
   &lt;make&gt;make&lt;/make&gt;
   &lt;model&gt;model&lt;/model&gt;
  
   &lt;recalls&gt;
     &lt;type&gt;Recall1&lt;/type&gt;
     &lt;date&gt;01/01/11&lt;/date&gt;
   &lt;/recalls&gt;
   &lt;recalls&gt;
     &lt;type&gt;Recall2&lt;/type&gt;
     &lt;date&gt;01/01/11&lt;/date&gt;
   &lt;/recalls&gt;
  
   &lt;engSpec&gt;
     &lt;power&gt;200HP&lt;/power&gt;
     &lt;size&gt;size&lt;/size&gt;
   &lt;/engSpec&gt;
  &lt;/car&gt;
  </code></pre>
  
  <p>But what I want the ArrayList to display differently, like this:</p>
  
  <pre><code>&lt;car&gt;
   &lt;vid&gt;vid&lt;/vid&gt;
   &lt;make&gt;make&lt;/make&gt;
   &lt;model&gt;model&lt;/model&gt;
  
   &lt;recalls&gt;
     &lt;recall&gt;
       &lt;type&gt;Recall1&lt;/type&gt;
       &lt;date&gt;01/01/11&lt;/date&gt;
     &lt;/recall&gt;
     &lt;recall&gt;
       &lt;type&gt;Recall2&lt;/type&gt;
       &lt;date&gt;01/01/11&lt;/date&gt;
     &lt;/recall&gt;
   &lt;/recalls&gt;
  
   &lt;engSpec&gt;
     &lt;power&gt;200HP&lt;/power&gt;
     &lt;size&gt;size&lt;/size&gt;
   &lt;/engSpec&gt;
  &lt;/car&gt;
  </code></pre>
  
  <p>Any idea how I can do this?
  I think the problem is with my schema, but I use this for the marshalling:</p>
  
  <pre><code>JAXBContext jc = JAXBContext.newInstance(Car.class);
  Marshaller marsh = jc.createMarshaller();
  marsh.marshal(car, out);
  </code></pre>
  
  <p>Any ideas how to fix this? Thanks!</p>