how to group-by xml nodes using xslt 1.0
<p>This is my xml</p>

<pre><code>&lt;hotel&gt;
    &lt;rooms&gt;
        &lt;room&gt;
            &lt;rates&gt;
                &lt;rates id="1" adult="1" child="0"&gt;&lt;rates&gt;
                &lt;rates id="2" adult="2" child="0"&gt;&lt;rates&gt;
                &lt;rates id="3" adult="1" child="0"&gt;&lt;rates&gt;
            &lt;/rates&gt;
        &lt;/room&gt;
        &lt;room&gt;
            &lt;rates&gt;
                &lt;rates id="4" adult="1" child="0"&gt;&lt;rates&gt;
                &lt;rates id="5" adult="2" child="0"&gt;&lt;rates&gt;
                &lt;rates id="6" adult="2" child="0"&gt;&lt;rates&gt;
            &lt;/rates&gt;
        &lt;/room&gt;
    &lt;/rooms&gt;
&lt;/hotel&gt;
</code></pre>

<p>How to make group by based on "Adults" and "Child" using xslt 1.0</p>

<p>same adult and child in one rates node and the way of grouping</p>

<p>result i need like below,</p>

<pre><code>&lt;hotel&gt;
    &lt;rooms&gt;
        &lt;room&gt;
            &lt;rates&gt;
                &lt;rates id="1" adult="1" child="0"&gt;&lt;rates&gt;
                &lt;rates id="3" adult="1" child="0"&gt;&lt;rates&gt;
                &lt;rates id="4" adult="1" child="0"&gt;&lt;rates&gt;
            &lt;/rates&gt;
        &lt;/room&gt;
        &lt;room&gt;
            &lt;rates&gt;
                &lt;rates id="2" adult="2" child="0"&gt;&lt;rates&gt;
                &lt;rates id="5" adult="2" child="0"&gt;&lt;rates&gt;
                &lt;rates id="6" adult="2" child="0"&gt;&lt;rates&gt;
            &lt;/rates&gt;
        &lt;/room&gt;
    &lt;/rooms&gt;
&lt;/hotel&gt;
</code></pre>