title: How to do a for-each-group in XSLT 1.0 without keys/Muenchian grouping
body: <p>I am currently working with XSLT and trying to group nodes by a sub-string of an attribute. The only thing is I'm working in an environment where I can't use an xsl:key. I was wondering the best way to go about grouping something such as:</p>
  
  <p><code>&lt;RESULTS&gt;
      &lt;RESULT ID="Result:1-1" Value="32" /&gt; 
      &lt;RESULT ID="Result:1-2" Value="3225" /&gt; 
      &lt;RESULT ID="Result:1-3" Value="372" /&gt;
      &lt;RESULT ID="Result:1-4" Value="64732" /&gt; 
      &lt;RESULT ID="Test:2-1" Value="6362" /&gt; 
      &lt;RESULT ID="Test:2-2" Value="352" /&gt;
      &lt;RESULT ID="Test:2-3" Value="325" /&gt;
      &lt;RESULT ID="Result:3-1" Value="3243" /&gt;
      &lt;RESULT ID="Result:3-2" Value="2332" /&gt;
      &lt;RESULT ID="Result:3-3" Value="342" /&gt;
      &lt;RESULT ID="Result:3-4" Value="2134" /&gt; 
  &lt;/RESULTS&gt;</code></p>
  
  <p>So that it could be formatted where there is a table that groups the Results by the last digit in the ID and displays their values. For example, it would group Result:1-1, Test:2-1, and Result:3-1 in the first table and list their values below it.</p>
  
  <p>Some sort of expected result would be:</p>
  
  <pre><code>| Table 1 |
  |---------|
  | 32      |
  | 6362    |
  | 3243    |
  
  | Table 2 |
  |---------|
  | 3225    |
  | 352     |
  | 2332    |
  
  | Table 3 |
  |---------|
  | 372     |
  | 325     |
  | 342     |
  
  | Table 4 |
  |---------|
  | 64732   |
  | 2134    |
  </code></pre>
  
  <p>Any suggestions as to certain methods of grouping to use or certain fuctions would be much appreciated!
  Thanks for reading and any help you have to offer!</p>