def annotate_fce_doc(xml):
    """Takes a FCE xml document and yields sentences with annotated errors."""
    result = []
    doc = cElementTree.fromstring(xml)
    paragraphs = doc.findall('head/text/*/coded_answer/p')
    for p in paragraphs:
        text = _get_formatted_text(p)
        result.append(text)

    return '\n'.join(result)
Takes a FCE xml document and yields sentences with annotated errors.
utils/prepare_clc_fce_data.py