use XML::DT ;
my $filename = shift;

%handler=( -default => sub{$elem_counter++;
                           $elem_table{$q}++;"";} #### $q -> element name
);

dt($filename,%handler);

print "<H3>We have found $elem_counter elements in document</H3>";
print "<TABLE><TH>ELEMENT<TH>OCCURS\n";
foreach $elem (sort keys %elem_table)
   {print "<TR><TD>$elem<TD>$elem_table{$elem}\n";}
print "</TABLE>";
