title: XSLT group similar tags and associate to another tag value
body: <pre><code>&lt;xml&gt;
  &lt;TimeCal Cal ="1"&gt;
  &lt;DateUse DateUse="2010-08-30"/&gt;
  &lt;DateUse DateUse="2010-08-31"/&gt;
  &lt;DateUse DateUse="2010-09-01"/&gt;
   &lt;DayCode DayCode="Mon"/&gt;
  &lt;DayCode DayCode="Tue"/&gt;
  &lt;DayCode DayCode="Wed"/&gt;
      &lt;/TimeCal&gt; 
  &lt;TimeCal Cal="2"&gt;
  &lt;DateUse  DateUse ="2010-09-01"/&gt;
  &lt;DateUse  DateUse ="2010-09-02"/&gt;
  &lt;DateUse  DateUse ="2010-09-06"/&gt;
  &lt;DateUse  DateUse ="2010-09-07"/&gt;
  &lt;Day Day="Mon"/&gt;
  &lt;Day Day="Tue"/&gt;
  &lt;Day Day="Wed"/&gt;
  &lt;Day Day="Thu"/&gt;
  &lt;/TimeCal&gt;
  &lt;TimeCal Cal="3"&gt;
  &lt;DateUse  DateUse ="2010-09-03"/&gt;
  &lt;DateUse  DateUse ="2010-09-10"/&gt;
  &lt;DateUse  DateUse ="2010-09-01"/&gt;
  &lt;Day Day="Fri"/&gt;
  &lt;/TimeCal&gt;
  &lt;TimeCal Cal="4"&gt;
  &lt;DateUse  DateUse ="2010-08-29"/&gt;
  &lt;DateUse  DateUse ="2010-09-05"/&gt;
  &lt;DateUse  DateUse ="2010-09-01"/&gt;
  &lt;Day Day="Sun"/&gt;
  &lt;/TimeCal&gt;
  &lt;TimeCal Cal="5"&gt;
  &lt;DateUse  DateUse ="2010-09-04"/&gt;
  &lt;DateUse  DateUse ="2010-09-11"/&gt;
  &lt;DateUse  DateUse ="2010-09-02"/&gt;
  &lt;Day Day="Sat"/&gt;
  &lt;/TimeCal&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>OUTPUT I want </p>
  
  <pre><code>DateUse          Cals
  ---------------- ----------------
  2010-08-30       1
  2010-08-31       1
  2010-09-01       1, 2, 3, 4
  2010-09-02       2, 5
  2010-09-03       3
  2010-09-04       5
  </code></pre>
  
  <p>and so on</p>
  
  <p>Assume that output (xml) as step1 now step2 output as follows from the step1 results</p>
  
  <h2>Unique Cal      Associated Day</h2>
  
  <p>1           Mon, Tue, Wed
  3           Fri
  5           Sat
  2, 5            Mon, Tue, Wed, Thu, SAT
  1, 2, 3, 4      Mon, Tue, Wed, Mon, Tue, Wed, Thu, Fri, Sun</p>