if(attribute != null && attribute.getValue() != null && attribute.getValue().trim().length() > 0) {
return attribute.getValue().trim();
}
else if(required) {
throw new SwsMissingRequiredElementAttributeInResponseException(attributeName, element.getName());
}
else {
return null;
}
}