title: Using multiple @xmlattribute annotations in one java class
body: <p>I saw many examples using multiple classes to define attributes at different levels. I have a lot of elements that need an additional entry in the XML, so it would make sense to have many files for this. My overall main goal is to add more data to an existing class. </p>
  
  <p>I am trying to change this</p>
  
  <pre><code>&lt;definition&gt;
    &lt;rows&gt;
      &lt;row&gt;1&lt;/row&gt;
    &lt;/rows&gt;
    &lt;columns&gt;
      &lt;column&gt;2&lt;/column&gt;
    &lt;/columns&gt;
  </code></pre>
  
  <p></p>
  
  <p>to either modify (change) or add attributes to each entry. I have these values in a map (1=Test1). I am trying to do something like this.</p>
  
  <pre><code>&lt;definition&gt;
  &lt;rows&gt;
      &lt;row name="Test1"&gt;1&lt;/row&gt;
  &lt;/rows&gt;
  &lt;columns&gt;
      &lt;column name="Test2"&gt;2&lt;/column&gt;
  &lt;/columns&gt;
  </code></pre>
  
  <p></p>
  
  <p>or this (The only problem with this is that I have these rows/cols stored as Integers in the source, and putting names would be in a string format)</p>
  
  <pre><code>&lt;definition&gt;
  &lt;rows&gt;
      &lt;row&gt;Test1&lt;/row&gt;
  &lt;/rows&gt;
  &lt;columns&gt;
      &lt;column&gt;Test2&lt;/column&gt;
  &lt;/columns&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is what I currently have in java.</p>
  
  <pre><code>public class Definition{    
      @XmlElementWrapper(name="rows")
      @XmlElement(name="row")
      @XmlElement (name="row_names")
      ...
      @XmlElementWrapper(name="cols")
      @XmlElement(name="col")
      @XmlElement (name="col_names")
  </code></pre>