title: Preserve order of attributes when modifying with minidom
body: <p>Is there a way I can preserve the original order of attributes when processing XML with minidom?</p>
  
  <p>Say I have: <code>&lt;color red="255" green="255" blue="233" /&gt;</code>
  when I modify this with minidom the attributes are rearranged alphabetically blue, green, and red. I'd like to preserve the original order.</p>
  
  <p>I am processing the file by looping through the elements returned by <code>elements = doc.getElementsByTagName('color')</code> and then I do assignments like this <code>e.attributes["red"].value = "233"</code>.</p>