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