<server description="<%= @description %>">

    <!-- Enable features -->
    <featureManager>
<% @features.each do |feature| -%>
        <feature><%= feature %></feature>
<% end -%>
    </featureManager>

<% @httpendpoints.each do |httpendpoint| -%>
    <httpEndpoint id="<%= httpendpoint["id"] %>"
                  host="<%= httpendpoint["host"] %>"
                  httpPort="<%= httpendpoint["httpport"] %>"
                  httpsPort="<%= httpendpoint["httpsport"] %>" 
    />
<% end -%>

<% if @includes != nil && @includes.size > 0 -%>
  <% @includes.each do |include| -%>
    <include location="<%= include %>" />
  <% end -%>
<% end -%>

</server>

<server description="<%= @description %>">

    <!-- Enable features -->
<% if @features != nil && @features.size > 0 -%>
    <featureManager>
  <% @features.each do |feature| -%>
        <feature><%= feature %></feature>
  <% end -%>
    </featureManager>
<% end -%>

<% if @httpendpoints != nil && @httpendpoints.size > 0 -%>
  <% @httpendpoints.each do |httpendpoint| -%>
    <httpEndpoint id="<%= httpendpoint["id"] -%>" 
      <% if httpendpoint["host"] != nil -%> host="<%= httpendpoint["host"] %>" <% end -%>
      <% if httpendpoint["httpport"] != nil -%> httpPort="<%= httpendpoint["httpport"] %>" <% end -%>
      <% if httpendpoint["httpsport"] != nil -%> httpsPort="<%= httpendpoint["httpsport"] %>" <% end -%>
    />
  <% end -%>
<% end -%>

<% if @includes != nil && @includes.size > 0 -%>
  <% @includes.each do |include| -%>
    <include location="<%= include %>" />
  <% end -%>
<% end -%>

</server>

Update template to make elements and attributes optional.
Update template to make elements and attributes optional.
