New API function to retrieve the value of an attribute.