in reply to User Input for Web Content

You could decide to transform the user blurb/article to conforming XHTML. For "entering" HTML, I would give the (non-technical) users some editor that ensures well-formedness, like fckEdit. Then you can just check that all tags are either paired or in a list of known unpaired tags.