in reply to XPath to read attributes using XML::LibXML ...

So, which Xpath should I use to read the value of the attribute of a node?

This worked for me:

my $rule_source = '//@attr1';