def segments_hash(segments_el):
    """Convert a list of segments elements into a hash, indexed by name."""
    shash = {}

    for segment_el in segments_el:
        shash[segment_el.name] = segment_el

    return shash