P4.xsl
<?xml version="1.0"?>
<x:stylesheet
xmlns:x="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<x:output method="html"/>
<x:strip-space elements="*"/>
<x:template match="/root">
<html>
<head>
<link rel="stylesheet" type="text/css" href="P4.css"/>
</head>
<body>
<h1>Directory listing</h1>
<ul>
<x:apply-templates/>
</ul>
</body>
</html>
</x:template>
<x:template match="file">
<li><x:value-of select="@name"/> -- <x:value-of select="@length"/> bytes</li>
</x:template>
<x:template match="directory">
<li>
<x:value-of select="@name"/>
<ul>
<x:apply-templates/>
</ul>
</li>
</x:template>
</x:stylesheet>