dropped parseDocTypeDecl, cleaned up some code