<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="/"><!-- Will match the root of the document and therefore run first -->
	    <html>
		    <body>
		    <xsl:call-template name="contacts" /><!-- Calls a template to run by name -->
            </body>
        </html>
	</xsl:template>
	
	<!-- A named template -->
	<xsl:template name="contacts">
		<h3>Contacts</h3>     
							  
		<xsl:apply-templates select="//item" /><!-- Apply all rules/templates that match the selector -->
	</xsl:template>
	
	<!-- A match/rule based template -->
	<xsl:template match="//item">
		<p><!-- Attributes can be added as below or using curly brace shorthand class="{group}" -->
			<xsl:attribute name="class">
				<xsl:value-of select="group"/>
			</xsl:attribute>
			<strong>
				<xsl:value-of select="name"/>
			</strong>
			<xsl:text> (</xsl:text>
				<xsl:value-of select="name/@nick"/>
			<xsl:text>) from </xsl:text><xsl:value-of select="company"/>
		</p>
	</xsl:template>
	
</xsl:stylesheet>
                