<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:template match="/"> 
        The people in the 2009 ARL XML Workshop are 
        <xsl:for-each select="workshop/*/person">
            <xsl:value-of select="name[@type='first']"/>
            <xsl:text> </xsl:text>
            <xsl:value-of select="name[@type='last']"/>
            <xsl:choose>
                <xsl:when test="position()=last()">.</xsl:when>
                <xsl:when test="position()=last()-1">, and </xsl:when>
                <xsl:otherwise>, </xsl:otherwise>
            </xsl:choose>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
