add selfClosing to element parsing and parse doctypes correctly