The WriteRaw method of the XPathDocumentWriter escapes the XML brackets < and > to < and > It seems that it behaves exactly as WriteString does.
Steps to reproduce:
XPathDocumentWriter xw = new XPathDocumentWriter();
xw.WriteStartElement("root");
xw.WriteRaw("<item>test</item>");
xw.WriteEndElement();
xw.Flush();
XPathNavigator xn = xw.Close();
Trace.WriteLine(xn.OuterXml);
The output is:
<root><item>test<item></root>
Whereas it should be:
<root><item>test</item></root>
Steps to reproduce:
XPathDocumentWriter xw = new XPathDocumentWriter();
xw.WriteStartElement("root");
xw.WriteRaw("<item>test</item>");
xw.WriteEndElement();
xw.Flush();
XPathNavigator xn = xw.Close();
Trace.WriteLine(xn.OuterXml);
The output is:
<root><item>test<item></root>
Whereas it should be:
<root><item>test</item></root>