[fix] added meta charset tag

I have added the meta charset tag, it improves the output for non-english languages.
[fix] added whitespaces between tags

The original output is perfectly valid but the code does not include the formatting whitespaces. This adds the thing.
[fix] endline behind the par closing tag
[fix] added tags for cleaner output code

Mainly \n, spaces. In case of footnotes, it would be better to number them starting with 1.
[fix] added newline tag after the <body>
adjusting some parts for xml