I'm not sure exactly what you want, but it sounds something like
<xsl:template match="products">
<xsl:for-each select="product[@type='garden']">
<xsl:sort select="name"/>
<xsl:copy-of select="."/>
</xsl:for-each>
<xsl:for-each select="product[@type='shop']">
<xsl:sort select="name"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference