in reply to Parsing XML file and removing the element

Please use code tags.
Back to the question use a XML::Parser, XML::Twig, XML::LibXML or XML::Simple.
with XML::Twig you can use
xml_grep --exclude dummy_record your_xml_file.xml
to get your desired results.
Boris