How can we write an XML file into a string variable? Here is the code I have,the variable content is supposed to return an XML string:
public string GetValues2()
{
string content = "";
XmlTextWriter textWriter = new XmlTextWriter(content, null);
textWriter.WriteStartElement("Student");
textWriter.WriteStartElement("r", "RECORD", "urn:record");
textWriter.WriteStartElement("Name", "");
textWriter.WriteString("Student");
textWriter.WriteEndElement();
textWriter.Close();
return contents;
}