<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:param name="PARTICIPANT-FILE"/>
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <participants>
            <xsl:for-each select="participants/participant">
                <xsl:copy-of select="."/>
            </xsl:for-each>
            <xsl:for-each select="document($PARTICIPANT-FILE)/participant">
                <xsl:call-template name="create-participant"/>
            </xsl:for-each>
        </participants>
    </xsl:template>
    <xsl:template name="create-participant">
        <participant>
            <organization>
                <xsl:value-of select="organization"/>
            </organization>
            <reporter>
            <xsl:for-each select="reporter">
                <xsl:variable name="email" select="email"/>               
                <a href="mailto:{$email}">
                    <xsl:value-of select="name"/>
                </a>
            </xsl:for-each>
            </reporter>
            <!--<implementation>
                <xsl:value-of select="implementation/name"/>, <xsl:value-of select="implementation/version"/>
            </implementation>-->
            <xsl:for-each select="roundref">
                <xsl:variable name="name" select="."/>
                <xsl:element name="{$name}">Yes</xsl:element>
            </xsl:for-each>
        </participant>
    </xsl:template>
</xsl:stylesheet>
