Any XSLT processor which conforms to the XSLT spec must deal with the document() function in this way if there is a problem with retrieving the XML document:
it may signal an error; if it doesn't, it must recover the error by returning an empty nodeset.
So, if, as you're saying, "this doesn't fail if the file is not present", then the function must return an empty nodeset, and you can simply test it by this:
Code:
<xsl:choose>
<xsl:when test="document('abcd.xsl')">
The file exists!
</xsl:when>
<xsl:otherwise>
Can't find the file...
</xsl:otherwise>
</xsl:choose>
Regards,
Armen