def process_txt(data, template):
if data is None:<EOL><INDENT>to_process = None<EOL><DEDENT>else:<EOL><INDENT>to_process = copy.deepcopy(data)<EOL>for datum in to_process:<EOL><INDENT>if isinstance(datum["<STR_LIT>"], list):<EOL><INDENT>datum["<STR_LIT>"] = "<STR_LIT:U+0020>".join(['<STR_LIT>' % entry.replace("<STR_LIT:;>", "<STR_LIT>")<EOL>for entry in datum["<STR_LIT>"]])<EOL><DEDENT>else:<EOL><INDENT>datum["<STR_LIT>"] = '<STR_LIT>' % datum["<STR_LIT>"].replace("<STR_LIT:;>", "<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>return process_rr(to_process, "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", template)<EOL>
Replace {txt} in template with the serialized TXT records