title: Programmatically Create XML File From XSD
body: <p>I have an XSD file and I want to create an XML file at runtime based on the XSD.  (My question is basically the same as <a href="https://stackoverflow.com/questions/307616/xml-instance-generation-from-xml-schema-xsd">this one</a>, except in the .NET world, rather than for Java.)</p>
  
  <p>I have run <code>xsd.exe /c /l:vb MyTest.xsd</code>, but that generates a class that cannot be instantiated and used, as it has nested classes that are never instantiated.  It appears that the generated class is only used for XML deserialization, but I don't have an XML file to deserialize from.</p>
  
  <p>Running <code>xsd.exe /d /l:vb MyTest.xsd</code> generates a dataset, but it looks like using that would be more coding than just writing out an <code>XmlDocument</code> manually.</p>
  
  <p>What is the best way to create an XML file based on a specific schema?</p>