In my project I have very big XSD file which i use to validate some XML request and response to a 3rd party.
For the above scenario I can have 2 approaches
1) Create XML and then validate against give XSD 2) Create classes from XSD with the help of XSD gen tool, add xtra bit of attirbutes and use them for validation.
Validation in the second way will work somewhat in this manner, a) convert xml request/response into object with XML Serialization b) validate the object with custom attributes set on each property, i.e. Pass the object to a method which will validate the object by iterating through properties and its custom attributes set on the each property, and this will return a boolean value if the object validates and that determines whether the xml request is valid or not?
Now the concern which approach is good in terms of performance and anything else???