I have such input\[code\]<NewDataSet> <StatInfo> <Type>Type1</Type> <Country>Country1</Country> <Value>1</Value> </StatInfo> <StatInfo> <Type>Type2</Type> <Country>Country1</Country> <Value>5</Value> </StatInfo> <StatInfo> <Type>Type2</Type> <Country>Country1</Country> <Value>2</Value> </StatInfo> <StatInfo> <Type>Type3</Type> <Country>Country1</Country> <Value>6</Value> </StatInfo> <Type>Type1</Type> <Country>Country2</Country> <Value>1</Value> </StatInfo> <StatInfo> <Type>Type2</Type> <Country>Country2</Country> <Value>5</Value> </StatInfo> <StatInfo> <Type>Type2</Type> <Country>Country2</Country> <Value>2</Value> </StatInfo> <StatInfo> <Type>Type3</Type> <Country>Country2</Country> <Value>6</Value> </StatInfo> ... </NewDataSet>\[/code\]So, I want to have table grouped by Country with general sum of Values AND in country grouped BY TYPE with general sum of value AND ALL general sum of values. AND all this in xslt 1.0\[code\]<table> <tr> <td>Country</td> <td>Type</td> <td>Value</td> </tr> <tr> <td>Country1</td> <td>Type1</td> <td>1</td> </tr> <tr> <td colspan="2">Sum By Type1</td> <td>1</td> </tr> <tr> <td>Country1</td> <td>Type2</td> <td>5</td> </tr> <tr> <td>Country1</td> <td>Type2</td> <td>2</td> </tr> <tr> <td colspan="2">Sum By Type2</td> <td>7</td> </tr> <tr> <td>Country1</td> <td>Type3</td> <td>6</td> </tr> <tr> <td colspan="2">Sum By Type3</td> <td>6</td> </tr> <tr> <td colspan="2">Sum By Country1</td> <td>14</td> </tr></table>\[/code\]