<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="bank">
	<html>
	<head><title>CS 4208 Bank</title></head>
	<body>
	<h1>List of All Customers</h1>
	<xsl:apply-templates/>
	</body>
	</html>
</xsl:template>

<xsl:template match="customer">
	<h2>
	<xsl:apply-templates select="@name"/>
	</h2>
	Lives in: <xsl:apply-templates select="@city"/>,
	<xsl:apply-templates select="@state"/>
	<br/>
	Accounts:
	<xsl:apply-templates select="account_type"/>
</xsl:template>

<xsl:template match="account_type">
	<ul>
		<li>Account Type: <xsl:apply-templates select="@account_type_code"/>
		Balance: <xsl:apply-templates select="@balance"/>
		<table border="1" bgcolor="orange">
			<tr>
				<th>Operation Type</th>
				<th>Operation Date</th>
				<th>Amount</th>
				<th>Destination Account</th>
			</tr>
			<xsl:apply-templates/>
		</table>
		
		</li>
		
	</ul>
</xsl:template>

<xsl:template match="account_activity">
	<tr>
		<td><xsl:apply-templates select="@operation_type"/></td>
		<td><xsl:apply-templates select="@operation_date"/></td>
		<td><xsl:apply-templates select="@amount"/></td>
		<td><xsl:apply-templates select="@dest_account"/></td>
	</tr>
</xsl:template>

</xsl:stylesheet>


