Sort and Choose an XML list with XSLT

I am trying to create a style sheet which I can sort elements by name for example or by their account user level

I have got a list displayed with their name, sex and user level but i would like the list sorted. It could be sorting the list by user level ascending 1-4, or it could be by name alphabetically or it could be all the females first then the males.

I have used sort in practice and it works on its own but not combined with other templates.

I would also like to replace the user level with
1 Normal User
2 Festival Volunteer
3 Festival Organiser
4 Administrator

I have got of these woking on their own but this has got me stumped as anything i try hides some of the data

stylesheet

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <h2>My CD Collection</h2>
  <xsl:apply-templates/>
  </body>
  </html>
</xsl:template>

<xsl:template match="member">
  <p>
  <xsl:apply-templates select="user/personal/name"/>
  <xsl:apply-templates select="user/personal/sex"/>
  <xsl:apply-templates select="user/account/userlevel"/>
  </p>
</xsl:template>

<xsl:template match="name">
  Name: <span style="color:#ff0000">
  <xsl:value-of select="."/></span>
  <br />
</xsl:template>

<xsl:template match="sex">
  Sex: <span style="color:#00ff00">
  <xsl:value-of select="."/></span>
  <br />
</xsl:template>

<xsl:template match="userlevel">
  <!--<xsl:choose>
	<xsl:when test="1">
		User Level: <span style="color:#0000ff">Normal User</span>
	</xsl:when>

	<xsl:when test="2">
		User Level: <span style="color:#0000ff">Festival Volunteer</span>
	</xsl:when>
	
	<xsl:when test="3">
		User Level: <span style="color:#0000ff">Festival Organiser</span>
	</xsl:when>
	
	<xsl:otherwise>
		User Level: <span style="color:#0000ff">Administrator</span>
	</xsl:otherwise>
  </xsl:choose>-->
  
  User Level: <span style="color:#000ff">
  <xsl:value-of select="."/></span>
  <br />
</xsl:template>

</xsl:stylesheet> 

and an example user

<member>
	<user id="1">
		<personal>
			<name>Abbie Hunt</name>
			<address1>108 Access Road</address1>
			<address2></address2>
			<city>Wells</city>
			<county>Somerset</county>
			<postcode>BA5 8GH</postcode>
			<telephone>01528927616</telephone>
			<mobile>07085252492</mobile>
			<email>adrock@gmail.com</email>
			<sex>Female</sex>
		</personal>
		<account>
			<username>AdRock</username>
			<password>269eb625e2f0cf6fae9a29434c12a89f</password>
			<userlevel>4</userlevel>
			<signupdate>2010-03-26 09:23:50</signupdate>
		</account>
	</user>
</member>

Fixed it