def getFirstChildElementByTagName(self, tagName):
 for child in self.childNodes:
  if isinstance(child, Element):
   if (child.tagName == tagName):
    return child
 return None

def getFirstChildElementByTagName ( self , tagName ) : for child in self . childNodes : if isinstance ( child , Element ) : if ( child . tagName == tagName ) : return child return None
return the first element of type tagname if found .