hii want to parse xml and read total content of the xml and want to some modification to the xml and place back the xml with the chnages what ever i made through the perl
use XML::Twig;use FileHandle;my $objXML = new XML::Twig;$objXML->parsefile([Path to XML File]); my $root = $objXML->root;my @root_children = $root->children();setNodes(\@root_children);sub setNodes {my $nodes_ref = shift;foreach my $node (@{$nodes_ref}) {my @childNodes = $node->children(); if($node->att([attribute name]) eq [some value]) {/* This is an edit example. I change the value of attributes of the current node */$node->set_att('[attribute name]', [New Value]);$node->set_att('[attribute name]', [New Value]); }elsif ($node->att([attribute name]) eq [some value]) { /* This is an add node example. I create a new node with 2 attributes */my $eblg= XML::Twig::Elt->new([Node Name] => {[attribute1 name] => [attribute1 value], [attribute2 name] => [attribute2 value]}); $eblg->paste( 'last_child', $node); # paste it in the document }if (@childNodes) { setNodes(\@childNodes);} }}$fh = new FileHandle "> [Path to XML File]";$objXML->set_pretty_print('record');$objXML->print($fh);