<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
<xsl:template match="/">
		<html>
			<head>
				<title>Organization Chart</title>
			</head>
			<body>
				<h5><i>Terry's Sales Report</i></h5>
				<p>Sales Departments Group Vice Presidents:</p>
				
				<xsl:for-each select="chairman/president/groupvp/department[. = 'Sales']">				 	
					<xsl:for-each select="parent::groupvp/name">						
						<ul>						
							<li><xsl:value-of select="."></xsl:value-of>, 
							ID: <xsl:value-of select="parent::groupvp/@empID"></xsl:value-of>
							(President: <xsl:value-of select="ancestor::president/name"></xsl:value-of>, 
							ID: <xsl:value-of select="ancestor::president/@empID"></xsl:value-of>)
							</li>												
						</ul> 						
					</xsl:for-each>					  
				</xsl:for-each>
				
				<h4>International Division World Regions Summary:</h4>				
				<xsl:for-each select="chairman/president/division[. = 'International']">
				<p><xsl:value-of select="parent::president/name"></xsl:value-of> (President). Note: Katie's employment date is <xsl:value-of select="parent::president/@empdate"></xsl:value-of>.</p>
				</xsl:for-each>			
				
				<xsl:for-each select="chairman/president/division[. = 'International']">
					<xsl:for-each select="parent::president/groupvp/director">	
						<xsl:sort select="child::region"/>					
						<ul>
							<li><xsl:value-of select="child::region"></xsl:value-of>: 
							The director is <xsl:value-of select="child::name"></xsl:value-of>
							(Employee ID: <xsl:value-of select="@empID"></xsl:value-of>)
							</li>							
						</ul> 					
					</xsl:for-each>	
			  </xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>


