title: Python lxml with minidom change element attributes order
body: <p>I've got problem with minidom. My code is: </p>
  
  <pre><code>from lxml import etree as ET
  from xml.dom import minidom
  
  xml_string = ET.tostring(self.model)
  
  reparsed = minidom.parseString(xml_string)        
  text = reparsed.toprettyxml(indent="   ")
  </code></pre>
  
  <p>I'm expecting (and when I try to print <strong>xml_string</strong> ,there is right argument order)</p>
  
  <pre><code>&lt;def id="A" set="normal"/&gt;
  </code></pre>
  
  <p>but minidom does changes to:</p>
  
  <pre><code>&lt;def set="normal" id="A"/&gt;
  </code></pre>
  
  <p>This is lxml tree code</p>
  
  <pre><code>temp = ET.SubElement(self.model,"def")
  temp.set("id", A)
  temp.set("set", "normal")
  </code></pre>