title: Incorrect order of attributes in Qt XML
body: <p>I have the following code:</p>
  
  <pre><code>element.clear();
  element.setTagName("accountpoint");
  element.setAttribute("code", QString(ID_CONST)+serial);
  element.setAttribute("name", QString());
  element.setAttribute("serial", serial);
  
  QFile file(filename);
  file.open(QIODevice::ReadWrite);
  QTextStream stream(&amp;file);
  doc.save(stream, 4);
  </code></pre>
  
  <p>I thought I will get an XML like:</p>
  
  <pre><code>&lt;accountpoint code="4871583314750580" name="" serial="14750580"&gt;
  </code></pre>
  
  <p>But I have:</p>
  
  <pre><code>&lt;accountpoint serial="14750580" code="4871583314750580" name=""&gt;
  </code></pre>
  
  <p>Why?</p>
  
  <p>P.S. Yes, of course, in XML document it does not matter, but I want to get the right order of attributes.</p>