A: 

One solution might be to implement IXmlSerializable interface on your class. I'm not sure if the XmlWriter will allow you to write a XML tag or not. http://stackoverflow.com/questions/279534/proper-way-to-implement-ixmlserializable

Erik Philips
Thanks for the suggestion but I think I found and easier way to deal with the problem.Tony
tony
Can you post what your answer was and mark it as the answer? I'm interested in what you came up with.
Erik Philips
A: 

Hello, I haven't found an easy way to customize the stylesheet or the encoding line but I found a good suggestion here:

link text

The idea is to pretty much write your own serialization class. I took the idea from the article and I created a class that serializes the class (using the C# library) then a filter modifies the header to modify the encoding line and add the stylesheet line.
When I load the xml, I read the file, I pass it through the filter to remove the stylesheet line and I change back the encoding line. Once I have done that, I use the de-serializer provided by C#. It seems to work.

Tony

tony