title: Validate C# object to XSD and generate xml output
body: <p>I have an object which has public properties.</p>
  
  <p>Say for e.g. an object called Regions and it looks something like this </p>
  
  <blockquote>
  <pre><code>public class Region
  {
  // public properties
   string name;
  
   string description;
  
   string timezone;
  
   string regionURL;
  
   string regioncode;
  
  }
  </code></pre>
  </blockquote>
  
  <p>Now I want to validate this object to region XSD which basically doesn't have all the properties which are present in the region object. And for the properties which are in the XSD I want to generate the output as XML.</p>
  
  <p>The region XSD looks like</p>
  
  <pre><code>&lt;xs:schema&gt;
  &lt;xs:complexType name="region"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="name" type="xs:string"/&gt;
        &lt;xs:element name="URl" type="xs:string"/&gt;
        &lt;xs:element name="code" type="xs:int"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Is there something inbuilt in .net which can be helpful? </p>