title: Testing Equivalence of xml.etree.ElementTree
body: <p>I'm interested in equivalence of two xml elements; and I've found that testing the tostring of the elements works; however, that seems hacky.</p>
  
  <p>Is there a better way to test equivalence of two etree Elements? </p>
  
  <p>Comparing Elements directly:</p>
  
  <pre><code>import xml.etree.ElementTree as etree
  h1 = etree.Element('hat',{'color':'red'})
  h2 = etree.Element('hat',{'color':'red'})
  
  h1 == h2  # False
  </code></pre>
  
  <p></p>
  
  <p>Comparing Elements as strings:</p>
  
  <pre><code>etree.tostring(h1) == etree.tostring(h2)  # True
  </code></pre>