title: Serialize Java List to XML using Jackson XML mapper
body: <p>Hi I need to create an XML from JAVA using Jackson-dataformat XMLMapper.
  The XML should be like</p>
  
  <pre><code>&lt;Customer&gt;
    &lt;id&gt;1&lt;/id&gt;
    &lt;name&gt;Mighty Pulpo&lt;/name&gt;
      &lt;addresses&gt;
        &lt;city&gt;austin&lt;/city&gt;
        &lt;state&gt;TX&lt;/state&gt;
      &lt;/addresses&gt;
      &lt;addresses&gt;
        &lt;city&gt;Hong Kong&lt;/city&gt;
        &lt;state&gt;Hong Kong&lt;/state&gt;
      &lt;/addresses&gt;
  &lt;/Customer&gt;
  </code></pre>
  
  <p>But I get it always like with an extra "&lt; addresses> &lt; /addresses>" tag.</p>
  
  <pre><code>&lt;Customer&gt;
    &lt;id&gt;1&lt;/id&gt;
    &lt;name&gt;Mighty Pulpo&lt;/name&gt;
  &lt;addresses&gt;
      &lt;addresses&gt;
        &lt;city&gt;austin&lt;/city&gt;
        &lt;state&gt;TX&lt;/state&gt;
      &lt;/addresses&gt;
      &lt;addresses&gt;
        &lt;city&gt;Hong Kong&lt;/city&gt;
        &lt;state&gt;Hong Kong&lt;/state&gt;
      &lt;/addresses&gt;
  &lt;addresses&gt;
  &lt;/Customer&gt;
  </code></pre>
  
  <p>I am using below code to create XML  </p>
  
  <pre><code>JaxbAnnotationModule jaxbAnnotationModule = new JaxbAnnotationModule();
  XmlMapper mapper = new XmlMapper();
  mapper.enable(SerializationFeature.INDENT_OUTPUT);
  mapper.registerModule(jaxbAnnotationModule);
  mapper.registerModule(new GuavaModule());
  String xml = mapper.writeValueAsString(customer);
  System.out.println(xml);
  </code></pre>
  
  <p>Please can some one help me? How can I remove the extra tag please. I have tried to use  @XmlElement but it does not help help. TIA!!</p>