How to write out XML

Mar 8, 2013 at 10:52 PM
I am using this to made a C# class from an XSD. Then I use that to populate the XML via the created objects. Once it is populated, I want to write the result out to XML. In LinqToXSD, you just said topElement.ToString() and all the XML was there. In Xsd2Code, that just writes out the type of the root element.

How do I take the root element of the C# class with all its subobjects and convert it to the raw XML?
Mar 8, 2013 at 10:57 PM
Of course as soon as I posted, I guessed that the serialization wasn't set. It looks like that is turned off by default. I regenerated the code and turned it on. You then do root.Serialize() and it spits out the XML.