Hello,
I am trying to take a QDomDocument and write to a .xml. I have got so far but now I can only produce empty documents.

Qt Code:
  1. QDomDocument doc("MyML");
  2. QDomElement root = doc.createElement("MyML");
  3. doc.appendChild(root);
  4.  
  5. QDomElement tag = doc.createElement("greetings");
  6. root.appendChild(tag);
  7.  
  8. QDomText t = doc.createTextNode("Hello World");
  9. tag.appendChild(t);
  10.  
  11. QString xml = doc.toString();
  12. cout << qPrintable(xml) << endl;
  13.  
  14.  
  15. QFile file("something.xml");
  16. if (!file.open(QIODevice::WriteOnly))
  17. {
  18. QTextStream TextStream(&file);
  19. TextStream << xml;
  20. file.close();
  21. }
  22.  
  23. return 0;
To copy to clipboard, switch view to plain text mode 

and this produces

Qt Code:
  1. <!DOCTYPE MyML>
  2. <MyML>
  3. <greetings>Hello World</greetings>
  4. </MyML>
To copy to clipboard, switch view to plain text mode 
any help would be much appreciated,
Thanks,
a.