Unfortunately you can't rely on this working: failure to access a document is a "recoverable error" so different processors will do different things (and it may depend on the kind of error, e.g. on-existent document versus bad XML content).
2.0 has a doc-available() function but the only ways to do it in 1.0 are processor-specific
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference