Like the original code, that's not universally true either.  Some elements may be auto-closed, some others require an explicit closing tag.

To be truly correct, we'd have to use a condition that checks for the definite list of element names (cf. XHTML spec) that may be auto-closed.