Sigil can test whether an epub format book is "well formed", that is, if the XML/XHTML in the file is properly tagged etc. You can download it from Google Code (
http://code.google.com/p/sigil/). Not sure if that's what you're looking for, but hope it helps.
Cheers,
FP