There are a variety of validators around but not necessarily autocorrecting.
CSE HTML Validator
is one. This will indicate errors in your code by line and make recommendations.
HTML Tidy
will autocorrect. I believe it does XHTML. Do a backup of your files before using it as the result may not always be what you want.
W3 run an online validator
http://validator.w3.org/. This will show you your errors.