use XML::LibXML; use warnings; use strict; my $file = (); my $value = 'name'; my $d = XML::LibXML->new->parse_file($file); my $attr = XML::LibXML::Attr->new($d [,$value]); for my $dead ($attr->findnodes(q{/category/subcategory[name = "Prestige"]})) { $dead->unbindNode; } __DATA__ 150 years of know how at the service of a same strategy: Taste images/bag_legal.jpg images/prestige.jpg Coffee Legal D A 250 Legal Prestige 12 800.55.01 /recipes/coffee1.html Experience the subtle voluptuousness of extraordinary Arabica coffee in your cup. Grand Arabica: incomparable pleasure in coffee. images/arabica.jpg Coffee Legal A D S 250 Grand Arabica 12 802.55.01