def tag_to_dict(node):
    """Assume tag has one layer of children, each of which is text, e.g.

      <medalline>
        <rank>1</rank>
        <organization>USA</organization>
        <gold>13</gold>
        <silver>10</silver>
        <bronze>9</bronze>
        <total>32</total>
      </medalline>

    """

    d = {}
    for child in node:
        d[child.tag] = child.text
    return d