topic stary ale aktualny

probowalem na rozne sposoby ale ciagle cos jest nie tak:
Generalnie chce zamienic znaczniki w <text> </text> takie jak <p/> i <grin/> (pozniej bedzie wiecej) na znaczniki htmlowe.
Edycja: owszem, parsuje mi <text> i pojawia sie to co chce, ALE w miejscu gdzie mial byc text, drugi raz pojawiaja sie date i author a tego nie chce

struktura xml
<document>
<post>
<author>Autor</author>
<date>Data</date>
<text>Jakis tekst hasdkhfjsdfhsjdf jfkjdkfg <grin/><p/>fgdfg d idfg df</text>
</post>
<post>
<author>Autor2</author>
<date>Data2</date>
<text>itp</text>
</post>
</document>
struktura xsl (tu pewnie bedzie syf bo dopiero zaczynam

)
<?xml version="1.0" encoding="ISO-8859-2" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML><HEAD></HEAD>
<BODY>
<xsl:apply-templates />
</BODY>
</HTML>
</xsl:template>
<xsl:template match="document" >
<table border="1" width="100%">
<tr><td colspan="2" align="</span>"><h2>tytul</h2></td></tr>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="document/post/text" >
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="document/post">
<tr>
<td width="115" align="center"><b><xsl:value-of select="author"/></b></td>
<td rowspan="2" valign="top"><xsl:apply-templates/></td>
</tr>
<tr>
<td valign="top"><small>
<xsl:value-of select="date"/></small><br/><div align="center">
<xsl:if test="author = 'A'"><img src="a.gif" alt="</span>" border="0"/></xsl:if>
<xsl:if test="author = 'B'"><img src="b.jpeg" alt="</span>" border="0"/></xsl:if>
<<<span style='color:blue'>span style='<span style='color:orange'>color:blue'>/div>
</td>
</tr>
<tr>
<td colspan="2" align="center"><p>--------------------------------------------------------------------------</p></td>
</tr>
</xsl:template>
<xsl:template match="p">
<br/><br/>
</xsl:template>
<xsl:template match="grin">
<img src="grin.gif" alt=""/>
</xsl:template>
</xsl:stylesheet>