(continuing http://www.qtcentre.org/threads/6000...-and-sub-nodes )

I am using QXmlStreamWriter, and under some conditions I need to write into a node, a text that contains raw xml, not encoded.

Qt Code:
  1. QString b = "<b>test 1 2 3 </b>";
  2. QXmlStreamWriter stream(&output);
  3. stream.writeStartDocument();
  4. stream.writeStartElement("a");
  5. stream.writeCharacters(b);
  6. stream.writeEndElement();
  7. stream.writeEndDocument();
  8. stream.close();
To copy to clipboard, switch view to plain text mode 

In this example, "b" gets encoded into XML, which is usually desired, but not in this case.

One solution I have is to write the XML manually as a text file. This will work, but I feel this is ugly.

What other alternatives to I have?