'Returns the named attribute of the specified element.
The element whose attribute to return is specified using ``source`` and
``xpath``. They have exactly the same semantics as with `Get Element`
keyword.
The value of the attribute ``name`` of the specified element is returned.
If the element does not have such element, the ``default`` value is
returned instead.
Examples using ``${XML}`` structure from `Example`:
| ${attribute} =  | Get Element Attribute | ${XML} | id | xpath=first |
| Should Be Equal | ${attribute}          | 1      |    |             |
| ${attribute} =  | Get Element Attribute | ${XML} | xx | xpath=first | default=value |
| Should Be Equal | ${attribute}          | value  |    |             |
See also `Get Element Attributes`, `Element Attribute Should Be`,
`Element Attribute Should Match` and `Element Should Not Have Attribute`.'

def get_element_attribute(self, source, name, xpath='.', default=None):

    return self.get_element(source, xpath).get(name, default)
