I have used xsd.exe for this as Joe has suggested above many times and it works well.
1. Look at the tutorial
http://dotnetjunkies.com/QuickStartv.../XSDToCls.aspx
2. Make a class out of your xsd.
3. populate the class instance.
4. Serialise the class:
http://dotnetjunkies.com/QuickStartv...bjFromXML.aspx
======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================