def getNextChildIndex(elementNode):
 for (childNodeIndex, childNode) in enumerate(elementNode.parentNode.childNodes):
  if (childNode == elementNode):
   return (childNodeIndex + 1)
 return len(elementNode.parentNode.childNodes)

def getNextChildIndex ( elementNode ) : for ( childNodeIndex , childNode ) in enumerate ( elementNode . parentNode . childNodes ) : if ( childNode == elementNode ) : return ( childNodeIndex + 1 ) return len ( elementNode . parentNode . childNodes )
get the next child index .