title: Select from a table as xml grouped by more than one level
body: <p>I'm using DB2 for z/OS V10.</p>
  
  <p>I need to select some data from a DB2 table direcly into XML with grouping the data on more then 1 level like the following example </p>
  
  <pre><code>&lt;actionCodeGrp&gt;
     &lt;actionCode&gt;A&lt;/actionCode&gt;
     &lt;ISINGrp&gt;
        &lt;ISIN&gt;DE0000000001&lt;/ISIN&gt;
        &lt;NAME&gt;ISIN-DE-1&lt;/NAME&gt;
        &lt;ISSUER&gt;AAA&lt;/ISSUER&gt;
     &lt;/ISINGrp&gt;
     &lt;ISINGrp&gt;
        &lt;ISIN&gt;DE0000000002&lt;/ISIN&gt;
        &lt;NAME&gt;ISIN-DE-2&lt;/NAME&gt;
        &lt;ISSUER&gt;BBB&lt;/ISSUER&gt;
     &lt;/ISINGrp&gt;
  &lt;/actionCodeGrp&gt;
  &lt;actionCodeGrp&gt;
     &lt;actionCode&gt;B&lt;/actionCode&gt;
     &lt;ISINGrp&gt;
        &lt;ISIN&gt;DE0000000003&lt;/ISIN&gt;
        &lt;NAME&gt;ISIN-DE-3&lt;/NAME&gt;
        &lt;ISSUER&gt;CCC&lt;/ISSUER&gt;
     &lt;/ISINGrp&gt;
     &lt;ISINGrp&gt;
        &lt;ISIN&gt;DE0000000004&lt;/ISIN&gt;
        &lt;NAME&gt;ISIN-DE-4&lt;/NAME&gt;
        &lt;ISSUER&gt;DDD&lt;/ISSUER&gt;
     &lt;/ISINGrp&gt;
  &lt;/actionCodeGrp&gt;
  </code></pre>
  
  <p>The columns named above are all part of the same relational table.
  All examples I found were only with max. one group by clause and I have no idea how to write a more complex query. Can someone help?</p>