What if, instead of doing this:
xw.WriteStartElement("rss version=\"2.0\"");xw.WriteAttributeString("xmlns", "g", null, "http://base.google.com/ns/1.0");
You did something like this:
xw.WriteStartElement("rss");xw.WriteAttributeString("version", "2.0");xw.WriteAttributeString("xmlns", "g", null, "http://base.google.com/ns/1.0");
I've never used XmlTextWriter before, but I'd think you should be able to add the version attribute after creating the rss tag, based on your code example. (Might wanna double-check my syntax)