def decorate_tree(tree, decorate_value):
    """
    Transform each node in the tree's id value
    into a tuple of `(decorate_value, node.id)`
    to use common ids across identical graphs but
    discriminable between attached copies.

    Parameters
    ----------
    tree: Glycan
    decorate_value: int

    Returns
    -------
    Glycan
    """
    for node in tuple(tree):
        node.id = decorate_value, node.id
        for i, substituent in node.substituents():
            substituent.id = decorate_value, substituent.id
    return tree
