Validation Patterns for Custom XML Documents | I have a web application that generates a medium sized XML dataset to be consumed by a third party.  

I thought it would be a good idea to provide some form of schema document for the XML that I generate so I pasted the XML into Visual Studio and got it to generate an XSD.  

The annoying thing is that my XML doesn't validate to the XSD that was generated!


Is it better to roll your own XSD?  

What about different schema docs like DTDs, Relax NG, or Schematron? 


The key is that I would like to be able to validate my document using C#. 


What are your XML validation strategies?