use strict; use XML::Simple; my @list; #read in your list into this array my $infile ; #name of the file of your original xml my $outfile; # name of the output file my $parser = XML::Simple->new(rootname=>"bulk-load",noattr=>1,keyattr=>['ISSN']); my $xml = $parser->XMLin($infile); foreach my $issn (@list){ delete $xml->{journal}->{$issn}; } $parser->XMLout($xml,outputfile=>$outfile);