Converting document to string if no codec is a bad idea

The document could be either very very large or not define a proper toString method.