conditional html around slot

Hi all

i need to put some html (p tag) around an image slot if the slot has an image in it. currently tidy complains that i can’t have a closing p without a p - does anybody know how i can do this. my code is below

thanks
michelle

		<!-- begin XSL -->
		<xsl:if test="//linkurl/@slotname ='Image - Related Content (150x59)'">
			<p class="ImageShadow">
		</xsl:if>
		<!-- end XSL -->

		<!-- start slot Image - Related Content (150x59) -->
		<!-- start snippet wrapper -->
		<span psxeditslot="yes" slotname="Image - Related Content (150x59)" />
		<!-- end snippet wrapper -->
		<!-- end slot Image - Related Content (150x59) -->
		
		<!-- begin XSL -->
		<xsl:if test="//linkurl/@slotname ='Image - Related Content (150x59)'">
			</p>
		</xsl:if>
		<!-- end XSL -->

<!-- begin XSL -->
<xsl:if test="//linkurl/@slotname ='Image - Related Content (150x59)'">
	[b]<xsl:text disable-output-escaping="yes">&lt;[/b]p class="ImageShadow">[b]</xsl:text>[/b]
</xsl:if>
<!-- end XSL -->

<!-- start slot Image - Related Content (150x59) -->
<!-- start snippet wrapper -->
<span psxeditslot="yes" slotname="Image - Related Content (150x59)" />
<!-- end snippet wrapper -->
<!-- end slot Image - Related Content (150x59) -->
		
<!-- begin XSL -->
<xsl:if test="//linkurl/@slotname ='Image - Related Content (150x59)'">
	[b]<xsl:text disable-output-escaping="yes">&lt;[/b]/p>[b]</xsl:text>[/b]
</xsl:if>
<!-- end XSL -->

great!!! - many thanks, i will give this a try now

thanks
michelle