Yes grouping is possible.
A good source of information for all things xsl is the XSL FAQ at:
http://www.dpawson.co.uk/xsl/xslfaq.html
There is a whole section on grouping where you can probably find the
answer to your question at:
http://www.dpawson.co.uk/xsl/sect2/N4486.html
If you can't find the answer there, I suggest you try to post your
question to the XSL mailing list at:
www.mulberrytech.com/xsl/xsl-list/index.html
That's probably a better place to ask XSL questions than this Java group.