Fix recursion only with case for Document
Merge pull request #92 from holgerschill/master

Fix infinite recursion