def pom_add_element(root, prefix, parent, child, values, comparison_keys, key_order):
    dependencies = root.find(prefix + parent)
    if dependencies is None:
        dependencies = Xml.Element(prefix + parent)
        root.append(dependencies)
    if not pom_check_if_child_exists(dependencies, prefix, values, comparison_keys):
        dep = Xml.Element(prefix + child)
        for key, value in sorted(values.items(), key=lambda i:key_order.index(i[0])):
            pom_add_or_modify_tag(dep, prefix + key, value)
        dependencies.append(dep)
Checks if an element (spark-package dependency or repository) exists, adds it if it doesn't.
dataset/ETHPy150Open databricks/spark-package-cmd-tool/python/spark_package/spark_package.py/pom_add_element