s = """<head>
  <tagName myatt="1"/>
  <tagName myatt="2"/>
  <tagName myatt="3"/>
  <otherTag>
    <otherDeeperTag>
      <tagName myatt="3.1"/>
      <tagName myatt="3.2"/>
      <tagName myatt="3.3"/>
    </otherDeeperTag>
  </otherTag> 
  <tagName myatt="4"/>
  <tagName myatt="5"/>
</head>"""
doc = parseString(s)
for e in doc.getElementsByTagName('tagName'):
    pass
Порядок элементов из минидома getElementsByTagName