title: Java: XML to Object and Object to XML with properties
body: <p>I have a not-little problem with my current project, and probably you can help me with this...</p>
  
  <p>When I worked before with xml messages, marshalling converted java objects to xml, where the java object attributes were set to xml nodes. But now I need to set that object attributes to xml node attributes, as I show here:</p>
  
  <pre><code>&lt;Identification_List counter=""&gt;
     &lt;Identification number="XXXXXXX" letter="X" name="PERSON"&gt;
        &lt;TravelList counter=""&gt;
            &lt;Travel travelType=""&gt;
        &lt;/TravelList&gt;
     &lt;/Identification&gt;
  &lt;/Identification_List&gt;
  </code></pre>
  
  <p>How can I do this? What framework should I use? Thank you!</p>
  
  <p>Edit: Example java class:</p>
  
  <pre><code>public class Identification {
    private int number;
    private char letter;
    private String name;
    private List&lt;Travel&gt; travelList;
  
    //Add here constructors, getters and setters
  }
  </code></pre>
  
  <p>That java class is the one that should be marshalled, where number, letter and name are the xml object properties</p>