If SortName is the name of an element, try something like this:
<xsl:sort select="./\*\[name()=$SortName\]"/>
[edit]Or if SortName is the name of an attribute, then use this:
<xsl:sort select="./@\*\[name()=$SortName\]"/>
[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p