my $parser = XML::LibXML->new(); my $doc = $parser->parse_file("main_file.XML"); my $doc1 = $parser->parse_file("second_file.XML"); my @nodes_from_main= $doc0->findnodes('//path/to/element/text()'); my @nodes_from_second = $doc1->findnodes('//path/to/element/text()'); #### for my $node_main (@nodes_from_main) { for my $node_second (@nodes_from_second) if (text from main equal text from second, "which I did already") {

print my matching node from the second file;
How to do this part

} esle { do nothing; } } ##
## matching text other text other text

I need to print everything within elements