my $file = 'xml.xml'; my $parser = XML::LibXML->new(); my $tree = $parser->parse_file($file); my @tmpinfo; foreach my $sample ($tree->findnodes('/table/Entry')) { $i=0; foreach my $content ($sample->findnodes('*')) { $tmpinfo[$i]=$content->textContent; $i++; print $tmpinfo[$i]; } $i++; }