use XML::LibXML; use Data::Dumper qw(Dumper); my $parser = XML::LibXML->new; my $doc = $parser->parse_file('pets.xml') or die; my $root = $doc->documentElement(); my $value = $root->nodeName; my $name; my $text; my $boolean; my $value; my $node; my $attribute; my @att; my $child; sub buildtree { my $node = shift; foreach my $children ( $node->getChildnodes ) { if( $children->nodeType eq &XML_ELEMENT_NODE ) { $name = $children->nodeName; $node = $children->nodeType; $text = $children->textContent($name); @att = $children->attributes(); $child = $children->hasChildNodes(); print "Name:$name\n"; print "Text:$text\n"; print "attrib:$attribute\n"; print "Attribute:@att\n"; print "Has Child:$child\n"; } buildtree( $children ); } } buildtree($root); Madness 150 Maggie Rosie