title: XSD generation from class, from code
body: <p>I want to write code that creates an XSD based on a C# class.</p>
  
  <p>I can't find information how to do this without using XSD.exe. Example class:</p>
  
  <pre><code>[XmlRoot("Sync")]
  public class SyncFileSettings : ISyncSettings
  {
     public SyncFileSettings(int pingIntervalSec, bool useCompression)
      {
          PingIntervalSec = pingIntervalSec;
          UseCompression = useCompression;
      }
  
      public int PingIntervalSec { get; set; }
      public bool UseCompression { get; private set; }
  }
  </code></pre>