'Recursively convert the nested task details dicts into SubElements
@param task: the task Element
@param data: the nested dict
@param keys: the mapping of dict keys to SubElement names'

@classmethod
def add_details(cls, task, data, keys):

    if (not isinstance(data, dict)):
        return
    SubElement = etree.SubElement
    for (key, name) in keys.items():
        wrapper = data.get(key)
        if (wrapper is None):
            continue
        if isinstance(name, dict):
            cls.add_details(task, wrapper, name)
        else:
            detail = SubElement(task, name)
            detail.text = s3_unicode(wrapper)
    return
