def METHOD_NAME(node, mode, capabilities):
    _validate_with_defaults_mode(mode, capabilities)
    with_defaults_element = sub_ele_ns(
        node,
        "with-defaults",
        NETCONF_WITH_DEFAULTS_NS,
    )
    with_defaults_element.text = mode