my $dom = XML::LibXML->load_xml( string => $jnx->{'server_response'}, # parser options ... ); my $xpc = XML::LibXML::XPathContext->new(); $xpc->registerNs('nc', 'urn:ietf:params:xml:ns:netconf:base:1.0'); $xpc->registerNs('j', 'http://xml.juniper.net/junos/12.3R9/junos'); my @nodes = $xpc->findnodes( "/nc:rpc-reply/nc:vlan-information", $dom); foreach my $node (@nodes){ print "\nAttempt 1\n"; my $attr_style = $node->findvalue('/@style'); $attr_style ? print "Got Attr _style_: $attr_style\n" : print "Couldn't find Attr _style_\n"; print "\nAttempt 2\n"; my $test1 = $node->hasAttributes(); print " Yes I have attribute(s)\n" if $test1; print "\nAttempt 3\n"; my @attrs = $node->attributes('/style'); foreach my $attr (@attrs){ print "here's an attribute: $attr->to_literal\n"; } print "\nAttempt 4\n"; my $attrnode = $node->getAttributeNodeNS( 'http://xml.juniper.net/junos/12.3R9/junos', 'style'); print "here's an attribute: $attrnode\n"; }