Added handling for new elements

New elements declarations/dtd and declarations/title were inserting
unwanted text.

Also fixed some ugly spacing in output.