Gives some private inner classes better names.

 JAVA-1427
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.