fix LP#1354652: crash when traversing internally loaded documents in XSLT extension functions