<network-instances xmlns="http://openconfig.net/yang/network-instance">
    <network-instance{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}>
        <name>{{name}}</name>
        {% if operation is not defined or operation != 'delete' %}
        <config>
            <name>{{name}}</name>
            <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type>
            {% for address_family in address_families %}
            <enabled-address-families xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:{{address_family}}</enabled-address-families>
            {% endfor %}
            <router-id>{{router_id}}</router-id>
            <route-distinguisher>{{route_distinguisher}}</route-distinguisher>
        </config>
        {% endif %}
    </network-instance>
</network-instances>
