I want  creating a custom exception to validate xml file.

Can you me show simple example for checking syntax or structure of xml file. For example: