#!/usr/bin/perl
use XML::DT;
  %handler = ( -default => sub{$c},
               person   => sub{ mkchristmascard($c); $c},
               -type    => { people => 'ARRAY',
                             person => MMAPON('address')});

  $people = dt("ex11.1.xml", %handler);

  print $people->[0]{address}[1];     # prints  address01

  sub mkchristmascard{ my $x=shift;
    open(A,"|mail jj\@di.uminho.pt ") or die;
    print A <<".";
    $x->{name}
    $x->{address}[0]

    Dear $x->{name}
      Merry Christmas from Braga perl mongers
.

  close A;
  }

