title: JaxB Unmarshalling attributes into a hashmap
body: <p>I have the following XML:   </p>
  
  <pre><code>&lt;object&gt;
      &lt;name&gt;Test&lt;/name&gt;
      &lt;bikes&gt;
          &lt;bike key="Hello" value="World"/&gt;
      &lt;/bikes&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>So I then have the following Objects:</p>
  
  <pre><code>    @XmlRootElement
      public class Object {
         @XmlElement
         private String name;
         @XmlElement
         private Bikes bikes;
  
         public Object(String name, Bikes bikes) {
                this.name =  name;
                this.bikes = bikes;
        }
  </code></pre>
  
  <p>Bikes</p>
  
  <pre><code>public class Bikes{
         private Map&lt;String, String&gt; bike = new HashMap();
         @XmlElement
         public Bikes(Map&lt;String, String&gt; bike) {
               this.bike = bike;
         }
  </code></pre>
  
  <p>I have tried to unmarshall the xml into the the above classes but I am not sure how.</p>
  
  <p>Found a couple of answers on here but none seemed to work as I needed.</p>