def getElementsByTagName(iNode, name):
 matches = []
 matches_append = matches.append
 slice = [iNode]
 while (len(slice) > 0):
  c = slice.pop(0)
  if (c.nodeName == name):
   matches_append(c)
  slice[:0] = c.childNodes
 return matches

def getElementsByTagName ( iNode , name ) : matches = [ ] matches_append = matches . append slice = [ iNode ] while ( len ( slice ) > 0 ) : c = slice . pop ( 0 ) if ( c . nodeName == name ) : matches_append ( c ) slice [ : 0 ] = c . childNodes return matches
return a list of all child elements of c{inode} with a name matching c{name} .