use strict; use warnings; use feature qw( say ); use XML::Smart qw( ); my $doc = XML::Smart->new(<<'__EOI__'); a b c __EOI__ my @children = $doc->{root}{node}[0]('@'); say @children == 5 ? "ok" : "XXX";