<?xml version="1.0" encoding="utf-8"?>
<service>
{% if short is defined %}
  <short>{{ short }}</short>
{% endif %}
{% if description is defined %}
  <description>{{ description }}</description>
{% endif %}
{% for tag in entry %}
{# Tags which can be used several times #}
{% if tag in ['port','protocol','source-port','module'] %}
{% for subtag in entry[tag] %}
  <{{ tag }}{% for name,value in subtag.items() %} {{ name }}="{{ value }}"{% endfor %}/>
{% endfor %}
{# Tags which can be used once #}
{% elif tag in ['destination'] %}
  <{{ tag }}{% for name,value in tag.items()|default({}) %} {{ name }}="{{ value }}"{% endfor %}/>
{% endif %}
{% endfor %}
</service>
