<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" /> <xsl:template match = "/icestats" > <icecast> <xsl:for-each select="source"> <mount><xsl:value-of select="@mount" /></mount> <xsl:choose> <xsl:when test="listener"> <xsl:variable name = "themount"><xsl:value-of select="@mount" /></xsl:variable> <xsl:for-each select="listener"> <users> <id><xsl:value-of select="ID" /></id> <ip><xsl:value-of select="IP" /></ip> <username><xsl:if test="username"> (<xsl:value-of select="username" />) </xsl:if></username>............... <time><xsl:value-of select="Connected" /></time> <client><xsl:value-of select="UserAgent" /></client> </users> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:for-each> </icecast> </xsl:template> </xsl:stylesheet>