title: JAXB Adding attributes to a XmlElement for simple data types
body: <p>I want to add some attributes to Xml Elements using JAXB when marshalling from JavaBeans. The Xml Elements are simple data types like String. So I do not want to create new Classes. For example, a desired output would be:</p>
  
  <pre><code>&lt;notifications&gt;
  &lt;date&gt;04/20/2011&lt;/date&gt;
  &lt;subject creditcard_num="22678" checknum="8904"&gt;Credit Card Charge Back&lt;/subject&gt;
  &lt;body payment_amount="34.00" return_status="charged back"&gt;some text&lt;/body&gt;
  &lt;/notifications
  </code></pre>
  
  <p>I do not want to define subject and body as separate classes.</p>
  
  <p>-Anand</p>