<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
			      xmlns:xlink="http://www.w3.org/1999/xlink">
     
<xsl:template match="*[count(*) > 0]">
    <xsl:element name="{name()}">
        <xsl:for-each select="@*">
            <xsl:attribute name="{name()}">
                <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

<xsl:template match="div1[@id='use-case-properties']/ulist">  
    <xsl:for-each select="item">
        <div2>
           <head><xsl:value-of select="p/kw"/></head>
           <div3><head>Definition</head><emph>(See Description)</emph></div3>
           <div3><head>Description</head>
           <p><xsl:value-of select="substring(p[1]/kw/following-sibling::text(), 2)"/></p>
           <xsl:apply-templates select="p[position() > 1 and string-length(.) > 1]"/>
           <xsl:text>&#10;</xsl:text>
           </div3>
           <xsl:text>&#10;</xsl:text>
        </div2>
        <xsl:text>&#10;&#10;</xsl:text>
    </xsl:for-each>
</xsl:template>

<xsl:template match="*|comment()|text()">
    <xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>


