####
####
####
#!/usr/bin/perl -w
use strict;
use XML::LibXML;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file("model.xml") or die "cannot open xml file: $!";
my $node = $doc->getDocumentElement();
my @dc = $child[0]->getElementsByTagName('descriptor');
foreach my $descr (@dc) {
foreach my $elt ($descr->childNodes())
{
next unless $elt->nodeType() == 1; #to avoid text nodes
$descr->addSibling($elt);
}
my $parent = $descr->parentNode;
$parent->removeChild($descr);
}
print $child[0]->serialize;