Doctype declaration added

Fixes #588 which is caused by the lack of doctype declaration. The doctype declaration gets lost because of a bug in lxml