title: JAXB: skip parent tag name
body: <p>As a summary: I need to place some fields directly into the root tag, skipping the tag of their direct parent.</p>
  
  <p>Detailed description:</p>
  
  <p>I have these classes:</p>
  
  <pre><code>@XmlRootElement
  class Root{
      protected Group1 group1;
      protected Group2 group2;
  }
  
  @XmlRootElement
  class Group1 {
      protected String field1;
      protected String field2;
      ...
      protected String field99;
  }
  
  @XmlRootElement
  class Group2 {
      protected String field101;
      ...
      protected String field199;
  }
  </code></pre>
  
  <p>Default JAXB marshalling will produce this XML:</p>
  
  <pre><code>&lt;root&gt;
     &lt;group1&gt;
       &lt;field1&gt;&lt;/field1&gt;
       &lt;field2&gt;&lt;/field2&gt;
       ...
       &lt;field99&gt;&lt;/field99&gt;
     &lt;/group1&gt;
  
     &lt;group2&gt;
       &lt;field100&gt;&lt;/field100&gt;
       ...
       &lt;field199&gt;&lt;/field199&gt;
     &lt;/group2&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I need the output to skip the parent tags (group1 and group2), and to incorporate the fields directly into the root element:</p>
  
  <pre><code>&lt;root&gt;
       &lt;field1&gt;&lt;/field1&gt;
       &lt;field2&gt;&lt;/field2&gt;
       ...
       &lt;field99&gt;&lt;/field99&gt;
       &lt;field100&gt;&lt;/field100&gt;
       ...
       &lt;field199&gt;&lt;/field199&gt;
  &lt;/root&gt;
  </code></pre>