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:
The file exists!
Can't find the file...