XML:getAttribute(path,attribute)

Return the value of the attribute.

. Returns null if the attribute does not exist.

The single argument form returns the value of an attribute of the current element.

The two argument form returns the value of an attribute of the element identified by the path. The first argument is the path and the second argument is the attribute.

Example
doc = XML.parse([[<cfg><opt type="test"/></cfg>]])
str = doc:getAttribute('/cfg/opt', 'type')