I am looking to create a simple code generator to convert XSD definitions to C# classes.  This is partly as a learning exercise, but I would also like to get some practical use out of it eventually.What would the general design of such an application look like?  I assume that I will need to use one of the XML parsers in the .NET framework, but which one? And what will the resulting data structure look like?  Will it be an expression tree?From there, what happens?  Do I generate code by concatenating strings, or are there better, more sophisticated ways to do it?Important:  I'm not looking for someone to write code for me (although very brief code samples are welcome, if they are applicable), and I don't need someone to do the research for me.  I'm perfectly capable of reading about parsers, expression trees and code generators myself.  I just need someone to help me with the broad brush strokes, so that I don't walk into too many blind alleys.  I'm also aware of open source projects like XSD2Code, but I'd rather make the attempt myself first, for learning reasons, and because the resulting tool is likely to be highly specific to my particular scenario.  
What would the general design for an XSD to C# class converter look like?
c#;design;xml;code generation