Sure - here is the .xsl file:<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0"><xsl:output method="text"/><!-- Comment: setting up a variable to create new line --><xsl:variable name="newline"><xsl:text></xsl:text></xsl:variable><!-- Comment: The registered variable uses the select expression to get all the RECORD element decendants in the XML document that have a child STAGECODE with value of Registered --><xsl:variable name="registered" select="//RECORD[sTAGECODE=Registered]"/><!-- Comment: The select expression uses the built-in XPATH count ( ) function that adds up the total number of nodes contained in the result tree fragmenmt stored in the registered variable --><xsl:variable name="totalRegStudents" select="count($registered)"/><xsl:variable name="tempRegisteredF" select="//RECORD[sTAGECODE=Temp Reg - Finance]"/><xsl:variable name="totalTempRegStudentsF" select="count($tempRegisteredF)"/><!-- Comment: First template to extract information and present in comma delimited format --><xsl:template match="/"> <xsl:for-each select="QLE/RECORD"> <!-- Comment: setting up the sort criteria for the output --> <xsl:sort select="SURNAME"/> <xsl:sort select="FAMILIARNAME"/> <!-- Comment: extracting student ID --> <xsl:value-of select="INSTITUTIONID"/> <xsl:text>,</xsl:text> <!-- Comment: removing the @roehampton.ac.uk from the E-mail Addr --> <xsl:value-of select="substring-before(INTERNALEMAIL, '@')" /> <xsl:text>,</xsl:text> <!-- Comment: removing the / from the Date of Birth --> <xsl:value-of select="translate(DATEOFBIRTH, '/', '')" /> <xsl:text>,</xsl:text> <xsl:value-of select="FAMILIARNAME"/> <xsl:text>,</xsl:text> <!-- Comment: replacing a space with hyphen in double-barreled surnames --> <xsl:value-of select="translate(SURNAME, ' ', '-')" /> <xsl:value-of select="$newline"/> </xsl:for-each> </xsl:template><!-- Comment: Second template to extract information and present as text description and number --><xsl:template match="/"><xsl:text>The total number of registered students: </xsl:text><xsl:value-of select="$totalRegStudents"/><xsl:value-of select="$newline"/><xsl:text>The total number of temporary registered students by Finance: </xsl:text><xsl:value-of select="$totalTempRegStudentsF"/><xsl:value-of select="$newline"/></xsl:template></xsl:stylesheet>....and here is fragment of the xml document:<QLE> <RECORD> <INTERNALEMAIL>bakkerh@roehampton.ac.uk</INTERNALEMAIL> <FAMILIARNAME>Hannah</FAMILIARNAME> <SURNAME>Baker</SURNAME> <INSTITUTIONID>03058947</INSTITUTIONID> <ACADEMICPERIOD>2005</ACADEMICPERIOD> <STUDENTID>ASA03058947</STUDENTID> <DATEOFBIRTH>13/03/78</DATEOFBIRTH> <STAGECODE>Registered</STAGECODE> <UCASID>032280159</UCASID> </RECORD> <RECORD> <INTERNALEMAIL>lockertp@roehampton.ac.uk</INTERNALEMAIL> <FAMILIARNAME>Pamela</FAMILIARNAME> <SURNAME>Lockert</SURNAME> <INSTITUTIONID>02018930</INSTITUTIONID> <ACADEMICPERIOD>2005</ACADEMICPERIOD> <STUDENTID>COO02018930</STUDENTID> <DATEOFBIRTH>23/06/82</DATEOFBIRTH> <STAGECODE>Temp Reg - Finance</STAGECODE> <UCASID>022496030</UCASID> </RECORD> </QLE>Appreciate your help.Good thoughts. Mike