I want to clear all of content in XmlTextWriter and StringWriter. Flush() didn't work out.
XmlDocument doc = new XmlDocument();
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
xw.WriteStartElement("AddPhoneQual");
xw.WriteElementString("Type", "B");
xw.WriteElementString("PhoneNumber", bookingDetails.PassengerList[0].PhoneNumber);
xw.WriteEndElement();
// End AddPhoneQual
doc.LoadXml(sw.ToString());
Now, i need to clear all of content and start to write in clear xw.
xw.Flush();
sw.Flush();
They didn't work.