QDomNode n = rootElement.firstChild(); QString str; QTextStream stream(&str); n.save(stream, QDomNode::CDATASectionNode,QDomNode::EncodingFromTextStream); qDebug()<<str;