Merge pull request #19 from vetio/master

Add support for writing the DocumentEnd-Tag after writing a Document.
Organize imports and source formatting.