Oh, next time I'm going to generate XML, remind me to use Mark Resmussen's ultra cool XML Fluent Interface library. her'es a killer snippet:
XmlOutput xo = new XmlOutput() .XmlDeclaration() .Node("root").Within() .Node("result").Attribute("type", "boolean").InnerText("true");
[via Glenn]