<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _xr_to_keyset(line):
    '''
    Parse xfsrestore output keyset elements.
    '''
    tkns = [elm for elm in line.strip().split(":", 1) if elm]
    if len(tkns) == 1:
        return "'{0}': ".format(tkns[0])
    else:
        key, val = tkns
        return "'{0}': '{1}',".format(key.strip(), val.strip())