def METHOD_NAME(game, outcome, doc, xml_parent):
    for (i, p) in enumerate(game.players):
        if outcome is not None:
            etree.SubElement(xml_parent, "payoff",
                             player=p.label).text = str(outcome[i])
        else:
            etree.SubElement(xml_parent, "payoff",
                             player=p.label).text = "0"