<interfaces xmlns="http://openconfig.net/yang/interfaces">
    <interface>
        <name>{{name}}</name>
        {% if operation is not defined or operation != 'delete' %}
        <config>
            <name>{{name}}</name>
        </config>
        {% endif %}
        <subinterfaces>
            <subinterface{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}>
                <index>{{index}}</index>
                {% if operation is not defined or operation != 'delete' %}
                <config>
                    <index>{{index}}</index>
                    <enabled>true</enabled>
                </config>
                <vlan xmlns="http://openconfig.net/yang/vlan">
                    <config>
                        <vlan-id>{{vlan_id}}</vlan-id>
                    </config>
                </vlan>
                <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
                    <addresses>
                        <address>
                            <ip>{{address_ip}}</ip>
                            <config>
                                <ip>{{address_ip}}</ip>
                                <prefix-length>{{address_prefix}}</prefix-length>
                            </config>
                        </address>
                    </addresses>
                </ipv4>
                {% endif %}
            </subinterface>
        </subinterfaces>
    </interface>
</interfaces>
