title: Validate json data against XSD schema in C#
body: <p>I am working on a project where we want to validate data against xsd schema, tricky part is data can be coming from same source in the form of json, xml etc. I have figured out how to get it to validate against xml. I haven't been able to do the same for JSON. I am trying to avoid having both json schema as well as xml schema. To do so I am converting my json file into a XmlDocument like this;</p>
  
  <pre><code>using (var r = new StreamReader(xmlFileSource))
  {
      var json = r.ReadToEnd();
  
      var xd = (XmlDocument)JsonConvert.DeserializeXmlNode(
          json.ToString(CultureInfo.InvariantCulture), fileName);
  }
  </code></pre>
  
  <p>I can't find a way to validate XmlDocument against an xsd file. Any help will be much appreciated, or if you have any recommendation to achieve the same task in a better way.</p>
  
  <p>Thanks!</p>