title: Jackson XML globally set element name for container types
body: <p>I'm using Jackson 1.9.2 with the <a href="https://github.com/FasterXML/jackson-dataformat-xml" rel="nofollow">XML dataformat module</a>. I need to tweak the way that Jackson serializes arrays, lists, collections.</p>
  
  <p>By default, with an int array property called <code>myProperty</code> containing a couple numbers, Jackson / XML is producing the following:</p>
  
  <pre><code>&lt;myProperty&gt;
    &lt;myProperty&gt;1&lt;/myProperty&gt;
    &lt;myProperty&gt;2&lt;/myProperty&gt;
  &lt;/myProperty&gt;
  </code></pre>
  
  <p>What I need to produce is:</p>
  
  <pre><code>&lt;myProperty&gt;
    &lt;item&gt;1&lt;/item&gt;
    &lt;item&gt;2&lt;/item&gt;
  &lt;/myProperty&gt;
  </code></pre>
  
  <p>I can do this on a per-POJO basis using a combination of <code>JacksonXmlElementWrapper</code> and <code>JacksonXmlProperty</code> like so:</p>
  
  <pre><code>@JacksonXmlElementWrapper(localname='myProperty')
  @JacksonXmlProperty(localname='item')
  public int[] myProperty;
  </code></pre>
  
  <p>This solution, however, would require that I manually apply these annotations to every array, list, collection in my POJOs. A much better solution would allow me to apply a solution once, globally, for all array, list, collection types. Any ideas on how to implement such a solution?</p>
  
  <p>Thanks!</p>