>How? Try-Catch and analyze the error message?
Yep, that would be one way.
You can even validate against a schema, if you had one (one of the things you can use XMLReaderSettings for).
But you never actually set any XMLreader settings, which is beginning to make me think that much of this looks like cut'n'pasted code from multiple sources without really knowing what the code is doing
You might want to examine the documentation for XMLReaderSettings and fore XML schemas