Is this closer to your needs?
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="blnPresent">
<xsl:call-template name='IsIDPresent'>
<xsl:with-param name='ID'>384</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test='$blnPresent="true"'>Value found</xsl:when>
<xsl:otherwise>Value not found</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name ='IsIDPresent'>
<xsl:param name='ID' />
<xsl:if test ='//FACILITY_RELATED/PES_ID = $ID'>true</xsl:if>
</xsl:template>
</xsl:stylesheet>
if it is you could do the samething without a template
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="blnPresent">
<xsl:if test ='//FACILITY_RELATED/PES_ID = 385'>true</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test='$blnPresent="true"'>Value found</xsl:when>
<xsl:otherwise>Value not found</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>