<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <features>
            <xsl:for-each select="features/feature">
                <feature>
                    <serial><xsl:value-of select="count(preceding-sibling::*) + 1"/></serial>
                    <xsl:variable name="section">
                        <xsl:value-of select="location/URI"/>
                    </xsl:variable>
                    <section><a href="{$section}"><xsl:value-of select="location/section"/></a></section>
                    <name><xsl:value-of select="name"/></name>
                    <testcase><xsl:for-each select="roundref"><xsl:variable name="roundref"><xsl:value-of select="."/></xsl:variable><a href="#{$roundref}"><xsl:value-of select="."/></a>
                        <br/></xsl:for-each></testcase>
                    <notes><xsl:value-of select="notes"/></notes>
                </feature>
            </xsl:for-each>
        </features>
    </xsl:template>
</xsl:stylesheet>
