'Parse the XML element and return a StorageVolume object.
:param      name: An optional name for the volume. If not provided
then either tag with a key "Name" or volume ID
will be used (which ever is available first in that
order).
:type       name: ``str``
:rtype:     :class:`StorageVolume`'

def _to_volume(self, element, name=None):

    volId = findtext(element=element, xpath='volumeId', namespace=NAMESPACE)
    size = findtext(element=element, xpath='size', namespace=NAMESPACE)
    raw_state = findtext(element=element, xpath='status', namespace=NAMESPACE)
    state = self.VOLUME_STATE_MAP.get(raw_state, StorageVolumeState.UNKNOWN)
    tags = self._get_resource_tags(element)
    name = (name if name else tags.get('Name', volId))
    extra = self._get_extra_dict(element, RESOURCE_EXTRA_ATTRIBUTES_MAP['volume'])
    extra['tags'] = tags
    return StorageVolume(id=volId, name=name, size=int(size), driver=self, state=state, extra=extra)
