code: def insert_sort(node, target):
      sort = target.sort
      lang = target.lang
      collator = Collator.createInstance(Locale(lang) if lang else Locale())
      for child in target.tree:
          if collator.compare(sort(child) or '', sort(node) or '') > 0:
              child.addprevious(node)
              break
      else:
          target.tree.append(node)