<?xml version="1.0" encoding="utf-8"?>
<tbook e="2" complete="true">
  {foreach $contacts as $row}
  <item context="active" type="{if $row.category == "extensions"}colleagues{else}none{/if}" index="{$row@index}">
    <first_name>{$row.contact_name_given}</first_name>
    <last_name>{$row.contact_name_family}</last_name>
    <number>{if $row.category == "extensions"}{$row.phone_extension}{else}{$row.phone_number}{/if}</number>
    <number_type>business</number_type>
  </item>
  {/foreach}
</tbook>