in reply to XPath to read attributes using XML::LibXML ...
This worked for me:
my $rule_source = '//@attr1'; [download]