找到了
QDomElement root = doc.documentElement();
QDomNodeList nodelist = root.childNodes();
QDomProcessingInstruction instruction;
instruction = doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\"");
doc.appendChild(instruction);
QDomElement root = doc.createElement(QString("PARAMETERS"));
doc.appendChild(root); //添加根元素