Sounds like you are looking for the XDocument.Errors object.

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
Is there a way to validate a document without doing submit -- and without
doing each and every field in custom code?
I have a scenario where I need to validate and it would be VERY helpful to
tap into the same process that XDocument.Submt() uses -- but without the
actual submission of data part.
-Greg