You cannot create data out of XML Schema Definition, because it represent not data, but meta-data. It is related to XML data in the same was as database schema is related to the database data. If you really want data representing meda-data, you need to parse Schema Definition in some program structure representing metadata; it can be done in different ways, depending on your decisions.
[EDIT]
Please see comments to this answer. All you need is this class:
https://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschema%28v=vs.110%29.aspx[
^].
You need to instantiate this class and, with its instance, read some instance of XML Schema:
https://msdn.microsoft.com/en-us/library/ms162681(v=vs.110).aspx[
^],
https://msdn.microsoft.com/en-us/library/5y5eyz59(v=vs.110).aspx[
^].
Then you can traverse that schema and generate some code, mapping schema properties to some .NET data type the way you find convenient for you. In certain cases, it may even make sense to generate whole assemblies on the fly, using
System.Reflection.Emit
:
https://msdn.microsoft.com/en-us/library/system.reflection.emit%28v=vs.110%29.aspx[
^].
(That last option would mean really difficult work which is hard to debug, good knowledge of IL and CIL, CLR model and other fundamentals.)
—SA