for match in xmldata.findall("events/event"): if match.findtext('periods/period/period_description') == "Game" and match.findtext('sporttype') == "Soccer": participant1 = match.findall('participants/participant')[0] participant2 = match.findall('participants/participant')[2] if participant1.findtext('participant_name') in ['Atletico Madrid'] and participant2.findtext('participant_name') in ['Liverpool']: print match