<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      exclude-result-prefixes="xs"
      version="2.0">
	<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<html>
			<head>
				<title><xsl:value-of select="/playlist/@name"/></title>
			</head>
			<body>
				<h1>Playlist: <xsl:value-of select="/playlist/@name"/></h1>
				<p>The following <xsl:value-of select="/playlist/@tracks"/> tracks are in the playlist <xsl:value-of select="/playlist/@name"/>, created by <xsl:value-of select="/playlist/information/name"/>, which has a total run time of <xsl:value-of select="/playlist/@time"></xsl:value-of>.</p>
				<ul>
					<xsl:for-each select="/playlist/track">
						<xsl:sort select="playCount" data-type="number" order="descending"/>
						<li><xsl:value-of select="playCount"/> plays: <xsl:value-of select="artist"/>. "<xsl:value-of select="name"/>." <span style="text-decoration:underline;"><xsl:value-of select="album"/></span>.</li>
					</xsl:for-each>
				</ul>
				<!-- Please keep the following. Thank you! -->
				<p>Playlist last updated <xsl:value-of select="/playlist/information/updated"/>. Output generated by <a href="http://jamesrskemp.com/apps/iTunesPlaylists2Xml/?xslt" onclick="window.open(this.href);return false;">iTunes Playlists to Xml</a>.</p>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>