if (descriptor.getCacheDuration() != null) { log.debug("Writting cacheDuration attribute to AffiliationDescriptor DOM element"); String cacheDuration = DOMTypeSupport.longToDuration(descriptor.getCacheDuration()); domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME, cacheDuration);