I create with the QDomDocument several QDomElements:

Qt Code:
  1. QDomElement bams = domDoc.createElement("BAMS");
  2. bams.setAttribute("rippleFilter", m_nRifi);
  3. bams.setAttribute("rangeShifter", m_nRashi);
  4. bams.setAttribute("rangeShifterDistance", m_lfRaShiDistance);
  5.  
  6. domNode.appendChild(bams);
  7.  
  8. QDomElement table = domDoc.createElement("TxTable");
  9. table.setAttribute("roll", m_fRoll);
  10. table.setAttribute("pitch", m_fPitch);
  11. table.setAttribute("lateral", m_fLateral);
  12. table.setAttribute("longitudinal", m_fLongitudinal);
  13. table.setAttribute("isocentricAngle", m_fIsoAngle);
  14. table.setAttribute("vertical", m_fVertical);
  15.  
  16. domNode.appendChild(table);
To copy to clipboard, switch view to plain text mode 

The output is:

<BAMS rangeShifterDistance="0" rippleFilter="0" rangeShifter="0"/>
<TxTable vertical="0" longitudinal="0" lateral="0" isocentricAngle="0" pitch="0" roll="0"/>
Is there any possibility to preserve the order of attributes?