open file.xml ; $h := hash . //@* ; echo { join "\n", keys $h } ; #### #! /usr/bin/perl use warnings; use strict; use XML::LibXML; my $xml = 'XML::LibXML'->load_xml( location => 'file.xml' ); my %h; for ($xml->findnodes('//@*')) { $h{ $_->value } = 1; } print "$_\n" for keys %h; #### //*[not(./*)]/@* #### #! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::Simple; my $xml = XMLin('file.xml', ForceArray => 1, KeyAttr => [], ForceContent => 1); my %h; @h{ map values %{ $_->[0] }, grep 'ARRAY' eq ref, map values %{ $_->[0] }, values %{ $xml->{tags}[0] } } = (); say for keys %h; #### ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,