Your query returns elements, and those have an getAttribute method.
If you wanted to go the xpath route, the xpath to the attribute node would be attribute::type, for which @type is a shortcut.
In reply to Re: Accessing node attribute with XML::XPath
by ikegami
in thread Accessing node attribute with XML::XPath
by iteration
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |