This bug is also in Radar as <rdar://4098268> The document() function is not implemented for XSLT.
*** This bug has been marked as a duplicate of 3274 ***