#!/usr/local/bin/python2 import xml.etree.ElementTree as ET e = ET.fromstring('') print list(e).index(e[1])