<xsl:stylesheet 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	version="1.0" 
	xmlns:exsl="http://exslt.org/common"
        extension-element-prefixes="exsl"
>

<xsl:output method="html" />

<xsl:template match="/">
	<xsl:variable name="songlist-result-tree-fragment">
		<xsl:apply-templates select="plist" />
	</xsl:variable>
	<ul>
	<xsl:for-each select="exsl:node-set($songlist-result-tree-fragment)/songlist/song">
		<li>
		<i>
		<xsl:value-of select="Artist" />
		</i>
		<xsl:text>: </xsl:text>
		<strong>
		<xsl:value-of select="Name" />
		</strong>
		</li>
	</xsl:for-each>
	</ul>
</xsl:template>

<xsl:template match="plist">
    <songlist>
        <xsl:apply-templates select="dict/dict/dict"/>
    </songlist>
</xsl:template>

<xsl:template match="dict">
    <song>
        <xsl:apply-templates select="key"/>
    </song>
</xsl:template>

<xsl:template match="key">
    <xsl:element name="{translate(text(), ' ', '_')}">
        <xsl:value-of select="following-sibling::node()[1]"/>
    </xsl:element>
</xsl:template>
</xsl:stylesheet>
