title: Unmarshal XML via JAXB
body: <p>I have a xml as follows:</p>
  
  <pre><code>&lt;VisitorDataList&gt;
    &lt;VisitorData&gt;
     &lt;Attribute1List&gt;
              &lt;Attribute1&gt;
                  &lt;Attribute1Name&gt;name1&lt;/Attribute1Name&gt;
                  &lt;Attribute1Id&gt;2&lt;/Attribute1Id&gt;
              &lt;/Attribute1&gt;
              &lt;Attribute1&gt;
                  &lt;Attribute1Name&gt;name1&lt;/Attribute1Name&gt;
                  &lt;Attribute1Id&gt;3&lt;/Attribute1Id&gt;
              &lt;/Attribute1&gt;
              &lt;Attribute1&gt;
                  &lt;Attribute1Name&gt;name1&lt;/Attribute1Name&gt;
                  &lt;Attribute1Id&gt;1&lt;/Attribute1Id&gt;
              &lt;/Attribute1&gt;
          &lt;/Attribute1List&gt;
       &lt;Attribute2List&gt;
              &lt;Attribute2&gt;
                  &lt;Attribute2Name&gt;name2&lt;/Attribute2Name&gt;
                  &lt;Attribute2Id&gt;113&lt;/Attribute2Id&gt;
              &lt;/Attribute2&gt;
              &lt;Attribute2&gt;
                  &lt;Attribute2Name&gt;name2&lt;/Attribute2Name&gt;
                  &lt;Attribute2Id&gt;115&lt;/Attribute2Id&gt;
              &lt;/Attribute2&gt;
              &lt;Attribute2&gt;
                  &lt;Attribute2Name&gt;name2&lt;/Attribute2Name&gt;
                  &lt;Attribute2Id&gt;114&lt;/Attribute2Id&gt;
              &lt;/Attribute2&gt;
          &lt;/Attribute2List&gt;
    &lt;/VisitorData&gt;
   &lt;/VisitorDataList&gt; 
  </code></pre>
  
  <p>The <code>Attribute1List</code> and <code>Attribute2List</code> is dynamic for both name and value, so they can be <code>Attribute3List</code> or <code>Attribute4List</code> and so on. Now i want to parse this xml via jAXB, the java bean is like:</p>
  
  <pre><code>@XmlRootElement(name = "VisitorDataList")
  public class VisitorDataList {
  
      @XmlElement(name = "VisitorData")
      public List&lt;Visitor&gt; getVisitors() {
          return visitors;
      }
  
      public void setVisitors(List&lt;Visitor&gt; visitors) {
          this.visitors = visitors;
      }
  
  }
  
  public class Visitor {
  
      private List&lt;String&gt; attributes= new ArrayList&lt;String&gt;();
  
          public List&lt;String&gt; getAttributes() {
          return attributes;
      }
  
      public void setAttributes(List&lt;String&gt; attributes) {
          this.attributes= attributes;
      }
  }
  </code></pre>
  
  <p>My question is how to map all the attribute names into one list? Thanks in advance.</p>