def parse_dimensions(root):
    """Returns a dictionary of dimensionalities."""

    dims = {}
    for node in root.find("{*}unitDimensionSet"):

        dimension = node.find('{*}dimension').text
        dims[dimension] = dict(
            name = node.find('{*}name').text,
            baseForConversion = node.find('{*}baseForConversion').text,
            canonicalUnit = node.find('{*}canonicalUnit').text,
        )
    return dims