<!-- Automatically generated by WhishList - https://gitlab.cern.ch/msilvaol/wishlist -->
{% set ns = namespace(last_n_levels=2) %}
<node id="{{ tree.name }}" description="{{ tree.description }}">
{%- for node in tree.descendants %}
    {%- for i in range(0,ns.last_n_levels-node.path_name.count('/'),1) %}
        </node>
    {%- endfor %}
    {%- if node.is_leaf %}
    {%- if node.width <= 32 %}
        <node id="{{ node.name }}" address="{{ '0x{0:08X}'.format(node.address[0]) }}" mask="{{ '0x{0:08X}'.format(node.mask[0]) }}" permission="{{ node.permission }}" description="{{ node.description }}"/>
    {%- endif -%}
    {%- else %}
        <node id="{{ node.name }}" address="{{ '0x{0:08X}'.format(node.address[0]) }}" description="{{ node.description }}">
    {%- endif -%}
    {%- set ns.last_n_levels = node.path_name.count('/') -%}
{%- endfor %}
    {%- for i in range(0,ns.last_n_levels-2,1) %}
        </node>
    {%- endfor %}
</node>