def separated_xml(zip_file):
    """ Generator to separate a large XML file with concatenated
    <us-patent-grant></us-patent-grant> root nodes. """
    xml_file = zip_file.namelist()[0]
    with zip_file.open(xml_file, 'r') as open_xml_file:
        data_buffer = [open_xml_file.readline()]
        for line in open_xml_file:
            if line.startswith(b'<?xml '):
                yield b''.join(data_buffer)
                data_buffer = []
            data_buffer.append(line)
        yield b''.join(data_buffer)
