my $twig = new XML::Twig( twig_handlers => { $person => \&getPerson, $tarif => \&getTarif, $adresse => \&getAdresse } ); $twig->parsefile( $export{ $docid }->[$FELDER{"XMLPFAD"}] ); . . . sub getPerson{ my( $twig, $pers)= @_; my %persTree = &getTreeFieldFromHash( $export{$merkDOCID}->[$FELDER{CATEGORYID}], "PERSON", %docsystree ); foreach my $item ( sort keys %persTree ){ if( defined($pers->first_child( $persTree{$item} ))){ $sDummy = encode('iso-8859-1',$pers->first_child( $persTree{$item} )->text); print LOGFILE $FELDER{$item}."\n"; $export{$merkDOCID}->[$FELDER{$item}] = $sDummy; } } }