title: XML Tag grouping in RTF Template to suppress duplicates
body: <p>My XML Tag generated is as follows-</p>
  
  <pre><code>&lt;P_MONTH&gt;01&lt;/P_MONTH&gt;
  
  
  -&lt;G_1&gt;
  
  &lt;DIVISION&gt;CA Division&lt;/DIVISION&gt;
  
  &lt;DISTRICT&gt;CA District&lt;/DISTRICT&gt;
  
  &lt;DEPARTMENT&gt;Global Operations&lt;/DEPARTMENT&gt;
  
  &lt;DEP_EMPL_COUNT&gt;9&lt;/DEP_EMPL_COUNT&gt;
  
  &lt;/G_1&gt;
  
  
  -&lt;G_1&gt;
  
  &lt;DIVISION&gt;CA Division&lt;/DIVISION&gt;
  
  &lt;DISTRICT&gt;CA District&lt;/DISTRICT&gt;
  
  &lt;DEPARTMENT&gt;Laboratory Services&lt;/DEPARTMENT&gt;
  
  &lt;DEP_EMPL_COUNT&gt;11&lt;/DEP_EMPL_COUNT&gt;
  
  &lt;/G_1&gt;
  
  
  -&lt;G_1&gt;
  
  &lt;DIVISION&gt;CA Division&lt;/DIVISION&gt;
  
  &lt;DISTRICT&gt;CA District&lt;/DISTRICT&gt;
  
  &lt;DEPARTMENT&gt;Corporate&lt;/DEPARTMENT&gt;
  
  &lt;DEP_EMPL_COUNT&gt;3&lt;/DEP_EMPL_COUNT&gt;
  
  &lt;/G_1&gt;
  
  
  -&lt;G_1&gt;
  
  &lt;DIVISION&gt;CA Division&lt;/DIVISION&gt;
  
  &lt;DISTRICT&gt;S District&lt;/DISTRICT&gt;
  
  &lt;DEPARTMENT&gt;Corporate Administration&lt;/DEPARTMENT&gt;
  
  &lt;DEP_EMPL_COUNT&gt;6&lt;/DEP_EMPL_COUNT&gt;
  
  &lt;/G_1&gt;
  
  
  -&lt;G_1&gt;
  
  &lt;DIVISION&gt;CA Division&lt;/DIVISION&gt;
  
  &lt;DISTRICT&gt;S District&lt;/DISTRICT&gt;
  
  &lt;DEPARTMENT&gt;Corporate Technology&lt;/DEPARTMENT&gt;
  
  &lt;DEP_EMPL_COUNT&gt;1&lt;/DEP_EMPL_COUNT&gt;
  
  &lt;/G_1&gt;
  </code></pre>
  
  <p>When I am using these tag like below in the RTF template- </p>
  
  <pre><code>DIVISION                            DISTRICT                    DEPARTMENT                 COUNT
  &lt;?for-each:G_1?&gt; &lt;DIVISION&gt;         &lt;DISTRICT&gt;                   &lt;DEPARTMENT&gt;             &lt;COUNT&gt; &lt;?end for-each?&gt;
  </code></pre>
  
  <p>This is giving an output like - </p>
  
  <pre><code>DIVISION              DISTRICT                          DEPARTMENT                      COUNT
  CA Division           CA District                     Global Operations                  9
  CA Division           CA District                     Laboratory Services                11
  CA Division           CA District                     Corporate                          3
  CA Division           S District                      Corporate Administration           6 
  CA Division           S District                      Corporate Technology               1
  </code></pre>
  
  <p>I want the repeated values in division and district to be suppressed and the output to look like - </p>
  
  <pre><code>DIVISION              DISTRICT                          DEPARTMENT                      COUNT
  CA Division           CA District                     Global Operations                  9
                                                        Laboratory Services                11
                                                        Corporate                          3
                        S District                      Corporate Administration           6 
                                                        Corporate Technology               1
  </code></pre>
  
  <p>How can this be achieved ? I am not being able to use for-each-group properly to group the tags. Can someone please help ?</p>