XmlTextWriter writer = null;
     writer = new XmlTextWriter (Console.Out);
   // writer = new XmlTextWriter(xmlstring, null);
     //Use indentation for readability.
     writer.Formatting = Formatting.Indented;
     writer.Indentation = 4;
      
     //Write an element (this one is the root).
     writer.WriteStartElement("RESPONDS");//根节点
     writer.WriteAttributeString("Return", "true");//返回属性
      writer.WriteStartElement("RESPOND");
     //Write the title element.
     writer.WriteStartElement("title");
     writer.WriteString("Pride And Prejudice");
          writer.WriteEndElement();     //Write the close tag for the root element.
     writer.WriteEndElement();
       writer.WriteStartElement("book1");     //Write the title element.
     writer.WriteStartElement("title");
     writer.WriteString("Pride And Prejudice");
     writer.WriteEndElement();     //Write the close tag for the root element.
     writer.WriteEndElement();
     writer.WriteEndElement();
             
     //Write the XML to file and close the writer.
     writer.Close();      
在这里能不能将生成的XML变为一 个string,不要先生成xml文件.