#!/usr/bin/perl use XML::DT ; my %tab = (); %handler=( '-default' => sub{$c}, '-type' => {parent => MMAPON("child"), child => "HASH"}, 'parent' => sub{ for $ch (@{$c->{child}}) {$tab{$c->{name}}{$ch->{position}} = $ch->{name}; } }, ); dt("ex11.3.xml",%handler); # $tab has the table that you probably want... @parents = sort (keys %tab); for $ch (qw(first secon third fourt)) { print "\n$ch |"; for $p (@parents) { print sprintf("%5s |",$tab{$p}{$ch});} }