In C# / .NET 2.0, when I serialize an object using XmlSerializer, what's the easiest way to validate the output against an XML schema?
The problem is that it is all too easy to write invalid XML with the XmlSerializer, and I can't find a way to validate the XML that does not look cumbersome. Ideally I would expect to set the schema in the XmlSerializer or to have a XmlWriter that validates.