in reply to searching the XML file for certain nodes
You can't do that with an XML processor. Your XML is not well-formed.
If you fix your XML, then you can use something like this to filter out the p's you don't want:
#!/usr/bin/perl use strict; use warnings; use XML::Twig; XML::Twig->new( twig_handlers => { 'p[@v="NO"]' => sub { $_->cut; } }, pretty_print => 'indented', ) ->parsefile( "myfile.xml") ->print;
|
|---|