import hashlib


def xmls_to_sha1s(iml_path_to_content):
    """Calculate the sha1 hex digest of each xml document"""
    iml_path_to_sha1 = {}
    for iml_path in iml_path_to_content:
        iml_path_to_sha1[iml_path] = hashlib.sha1(str(iml_path_to_content[iml_path]).encode('utf-8')).hexdigest()
    return iml_path_to_sha1