def _write_serializer(fh, serializer, embl_key, data):
    """A simple method to write serializer to a file. Append 'XX'"""
    out = serializer(embl_key, data)
    if iter(out) is iter(out):
        for s in out:
            fh.write(s)
    else:
        fh.write(out)
    fh.write('XX\n')
