title: XML deserialization to POJO using Jackson XmlMapper
body: <p>Using Jackson XmlMapper annotations, how would I deserialize this XML into a pojo?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;open&gt;
     &lt;creds priv="write" type="internal"&gt;
        &lt;user&gt;Username1&lt;/user&gt;
        &lt;client_token&gt;abcplaudzrbcy37c&lt;/client_token&gt;
        &lt;client_secret&gt;0cxDE3LE0000=&lt;/client_secret&gt;
     &lt;/creds&gt;
     &lt;creds priv="read" type="internal"&gt;
        &lt;user&gt;Username1&lt;/user&gt;
        &lt;client_token&gt;123plaudzrbcy37c&lt;/client_token&gt;
        &lt;client_secret&gt;0cxDE3LE1234=&lt;/client_secret&gt;
     &lt;/creds&gt;
     &lt;creds priv="none" type="internal"&gt;
        &lt;user&gt;Username1&lt;/user&gt;
        &lt;client_token&gt;000plaudzrbcy37c&lt;/client_token&gt;
        &lt;client_secret&gt;0cxDE3LEabcd=&lt;/client_secret&gt;
     &lt;/creds&gt;
  &lt;/open&gt;
  </code></pre>
  
  <p>I attempted to use something like this: </p>
  
  <pre><code>@JacksonXmlRootElement(localName = "Open")
  public class OpenCredentials {
  
      @JacksonXmlProperty(localName = "Credentials")
      private Credentials[] credentials;
  
  }
  
  
  class Credentials {
  
      @JacksonXmlProperty(isAttribute = true)
      private String priv;
  
      @JacksonXmlProperty(isAttribute = true)
      private String type;
  
      @JacksonXmlProperty(localName = "Creds")
      private Creds[] creds;
  }
  
  
  class Creds {
  
      @JacksonXmlText(value = true)
      private String user;
  
      @JacksonXmlText(value = true)
      private String client_token;
  
      @JacksonXmlText(value = true)
      private String client_secret;
  }
  </code></pre>
  
  <p>When I tried to use XmlMapper's readValue(), I get the following error:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Duplicate property '' for [simple type, class com.company.data.utils.api.Creds]
  at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:268)
  at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
  </code></pre>