'Scan the given multilang (UDL-based) buffer and return a CIX
element tree, and shuffle any CSL tokens to the CSL CileDriver.'

def scan_multilang(self, buf, csl_cile_driver=None):

    log.info('scan_multilang:    path:    %r    lang:    %s', buf.path, buf.lang)
    tree = Element('codeintel', version='2.0')
    path = buf.path
    if (sys.platform == 'win32'):
        path = path.replace('\\', '/')
    file_node = SubElement(tree, 'file', lang=buf.lang, path=path)
    (csl_tokens, has_perl_code) = perlcile.scan_multilang(buf.accessor.gen_tokens(), file_node)
    blob_node = file_node.getchildren()[0]
    if (not has_perl_code):
        assert (len(blob_node) == 0)
        file_node.remove(blob_node)
    else:
        blob_node.set('name', basename(path))
    if (csl_cile_driver and csl_tokens):
        csl_cile_driver.scan_csl_tokens(file_node, basename(buf.path), csl_tokens)
    return tree
