title: FasterXML: POJO serialization to XML. JacksonXml Annotations not working
body: <p>I'm serializing a Java POJO to xml and want to change the xml tag names. I can't get this working however, the @JacksonXmlElementWrapper and @JacksonXmlProperty annotations don't get picked up. </p>
  
  <p>Maven pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;groupId&lt;/groupId&gt;
      &lt;artifactId&gt;TestJackson&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;properties&gt;
      &lt;/properties&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;central&lt;/id&gt;
              &lt;name&gt;Maven repository&lt;/name&gt;
              &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-xml-databind&lt;/artifactId&gt;
              &lt;version&gt;0.6.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.dataformat&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-dataformat-xml&lt;/artifactId&gt;
              &lt;version&gt;2.6.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.woodstox&lt;/groupId&gt;
              &lt;artifactId&gt;woodstox-core&lt;/artifactId&gt;
              &lt;version&gt;5.0.1&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>The Java classes:</p>
  
  <pre> <code> 
  package com.company;
  
  import com.fasterxml.jackson.dataformat.xml.annotation.*;
  
  import java.util.List;
  
  public class OrderItem {
  
      private String myId = null;
  
      @JacksonXmlElementWrapper(useWrapping = false)
      @JacksonXmlProperty(localName = "service")
      private List services = null; //
  
      public void setId(String myId) {
          this.myId = myId;
      }
  
      public void setServices(List myServices) {
          this.services = myServices;
      }
  
      public String getId() {
          return myId;
      }
  
      public List getServices() {
          return services;
      }
  }
  
  
  package com.company;
  
  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class Order {
  
      @JacksonXmlElementWrapper(useWrapping = false)
      @JacksonXmlProperty(localName = "items")
      private List items = new ArrayList();
  
      public void setItems(List items) {
          this.items = items;
      }
  
      public List getItems() {
          return items;
      }
  }
  
  
  package com.company;
  
  import com.fasterxml.jackson.dataformat.xml.annotation.*;
  
  import java.util.List;
  
  public class OrderItem {
  
      private String myId = null;
  
      @JacksonXmlElementWrapper(useWrapping = false)
      @JacksonXmlProperty(localName = "service")
      private List services = null; //
  
      public void setId(String myId) {
          this.myId = myId;
      }
  
      public void setServices(List myServices) {
          this.services = myServices;
      }
  
      public String getId() {
          return myId;
      }
  
      public List getServices() {
          return services;
      }
  }
  </code> </pre> 
  
  <p>The xml produced is not what I expect. What am I doing wrong?</p>
  
  <pre><code>&lt;Order&gt;
    &lt;items&gt;
      &lt;items&gt;
        &lt;services&gt;
          &lt;services&gt;service00&lt;/services&gt;
          &lt;services&gt;service01&lt;/services&gt;
          &lt;services&gt;service02&lt;/services&gt;
          &lt;services&gt;service03&lt;/services&gt;
          &lt;services&gt;service04&lt;/services&gt;
        &lt;/services&gt;
        &lt;id&gt;id0&lt;/id&gt;
      &lt;/items&gt;
      &lt;items&gt;
        &lt;services&gt;
          &lt;services&gt;service10&lt;/services&gt;
          &lt;services&gt;service11&lt;/services&gt;
          &lt;services&gt;service12&lt;/services&gt;
          &lt;services&gt;service13&lt;/services&gt;
          &lt;services&gt;service14&lt;/services&gt;
        &lt;/services&gt;
        &lt;id&gt;id1&lt;/id&gt;
      &lt;/items&gt;
      &lt;items&gt;
        &lt;services&gt;
          &lt;services&gt;service20&lt;/services&gt;
          &lt;services&gt;service21&lt;/services&gt;
          &lt;services&gt;service22&lt;/services&gt;
          &lt;services&gt;service23&lt;/services&gt;
          &lt;services&gt;service24&lt;/services&gt;
        &lt;/services&gt;
        &lt;id&gt;id2&lt;/id&gt;
      &lt;/items&gt;
      &lt;items&gt;
        &lt;services&gt;
          &lt;services&gt;service30&lt;/services&gt;
          &lt;services&gt;service31&lt;/services&gt;
          &lt;services&gt;service32&lt;/services&gt;
          &lt;services&gt;service33&lt;/services&gt;
          &lt;services&gt;service34&lt;/services&gt;
        &lt;/services&gt;
        &lt;id&gt;id3&lt;/id&gt;
      &lt;/items&gt;
      &lt;items&gt;
        &lt;services&gt;
          &lt;services&gt;service40&lt;/services&gt;
          &lt;services&gt;service41&lt;/services&gt;
          &lt;services&gt;service42&lt;/services&gt;
          &lt;services&gt;service43&lt;/services&gt;
          &lt;services&gt;service44&lt;/services&gt;
        &lt;/services&gt;
        &lt;id&gt;id4&lt;/id&gt;
      &lt;/items&gt;
    &lt;/items&gt;
  &lt;/Order&gt;
  </code></pre>