<!-- Created by Michael Williams, Abbeyworkshop.com, 2004 -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:redirect="http://xml.apache.org/xalan/redirect"
	extension-element-prefixes="redirect"
	version="1.0"
>
<xsl:output method="xml"/>

<xsl:template match="/">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="student_list">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="student">
	<xsl:variable name="filename" select="concat(@id,'.xml')" />
	<redirect:write select="$filename">
		<student id="{@id}">
			<xsl:apply-templates />
		</student>
	</redirect:write>
</xsl:template>

<xsl:template match="name | major | phone | email">
	<xsl:copy-of select="." />
</xsl:template>

</xsl:stylesheet>