in reply to Validating HTML structures

Have you looked at HTML::Lint and HTML::Tidy yet?

xoxo,
Andy