my $parser =XML::LibXML->new(); my $doc =$parser->parse_file($file) or die $!; my $root =$doc->getDocumentElement; my $searchPath="/configuration"; my ($val)=$root->findnodes($searchPath); my $propTag=$doc->createElement("property"); $val->appendChild($propTag); my $nameTag=$doc->createElement("name"); $nameTag->appendTextNode($name); $propTag->appendChild($nameTag); $doc->setDocumentElement($root); $doc->toFile($file,1);