def split_element(s, elements):
    """Split a string using a list of starting elements"""
    candidates = []
    for element in elements:
        if not s.startswith(element):
            continue
        candidates.append(element)

    if len(candidates) == 0:
        return

    if len(candidates) > 2:
        raise Exception('Found more than 2 matching XML elements')

    # If more than 1 element is found, use the longest one
    found_element = max(candidates, key=len)
    return "%s.%s" % (s[0:len(found_element)], s[len(found_element):])