title: JAXB/Jackson XML generic serialization
body: <p>I have a <code>Shape</code> class, and a <code>Circle</code> and <code>Square</code> subclasses. Then I have a <code>Container</code> class that has a <code>List&lt;Shape&gt; shapes</code> field.</p>
  
  <p>I'm doing XML serialization with Jackson, and I'm getting</p>
  
  <pre><code>&lt;shapes&gt;&lt;shape radius=".."&gt;&lt;shape w=".." h=".."&gt;&lt;/shapes&gt;
  </code></pre>
  
  <p>...but what I really want is</p>
  
  <pre><code>&lt;shapes&gt;&lt;circle radius=".."&gt;&lt;square w=".." h=".."&gt;&lt;/shapes&gt;
  </code></pre>
  
  <p>I've tried annotating <code>shapes</code> with</p>
  
  <pre><code>@XmlElements({
          @XmlElement(type = Circle.class),
          @XmlElement(type = Square.class)
  })
  </code></pre>
  
  <p>...but that just gives me</p>
  
  <pre><code>&lt;shapes&gt;&lt;shapes&gt;&lt;Circle radius=".."&gt;&lt;/shapes&gt;&lt;shapes&gt;&lt;Square w=".." h=".."&gt;&lt;/shapes&gt;&lt;/shapes&gt;
  </code></pre>
  
  <p>...so it's almost right, but those wrappers are annoying. Is there any way of getting what I want, even if it means changing my JAXB implementation?</p>