title: JAXB java.util.Map to key value pairs
body: <p>I'd like to marshall/unmarshall a Map into attributes of an XML element.  I've seen examples like:</p>
  
  <pre><code>&lt;map&gt;
  &lt;entry key="key1"&gt;value1&lt;/entry&gt;
  &lt;entry key="key2"&gt;value2&lt;/entry&gt;
  &lt;/map&gt;
  </code></pre>
  
  <p>What I really want is:</p>
  
  <pre><code>&lt;map key1="value1" key2="value2"/&gt;
  </code></pre>
  
  <p>Assume with me that there are no complex values and that they can legally be represented as XML attributes.  Also, I'm trying to write this generically because the set of keys is not known until runtime.</p>
  
  <p>How would I go about this?  I'm familiar with XmlJavaTypeAdapter.</p>
  
  <p>I thought about creating a MyMap that contains a List of entries but this wouldn't get the output I'd like.</p>