Take into account setting for explicit start and end for empty documents.
Fixed format support for multiple documents in the same file.
Made empty document completely empty.