def METHOD_NAME(svgtree, cfg):
    if not cfg.get("title"):
        return
    root = svgtree.getroot()
    ns = root.nsmap.get(None, "")
    # set title tag
    title = root.find(f"{{{ns}}}title")
    if title is None:
        title = etree.Element("title")
        root.append(title)
    title.text = cfg["title"]
    # add aria attr
    root.attrib["aria-labelledby"] = "title"