I am trying to squeeze as much performance as i can from a custom HttpHandler that serves Xml content.
I\' m wondering which is better for performance. Using the Xm
Honestly until you really, really, really, really, really need to care about performance... don't.
Go with the more maintainable solution first, and only compromise when performance becomes a measurable issue. XmlTextWriter offers you the benefit of "Knowing" about how Xml is supposed to work. StringBuilder does not, and is therefore error prone. You don't want to spend a day tracking down a malformed node somewhere in your gnarly stringbuilder code.
Let the framework work for you.