Fix retrieving elements when they are within a document node (like returned by XProc).