def structureStrFromNode(app, n):
    """The heading of a structure to which a node belongs.

    Compare `tf.core.text.Text.headingFromNode`.


    node: integer
        The node from which we obtain a structure specification.

    Returns
    -------
    structure heading:string
        Corresponds to the first structure node containing the first slot of `n`.
        The result is built from the labels of the individual section levels.
    """

    api = app.api
    T = api.T

    struct = T.headingFromNode(n)

    sep = ''
    result = ''

    for (i, part) in enumerate(struct):
        if part is None:
            continue
        (nType, label) = part
        result += f'{sep}<span class="nd">{nType}</span> {label}'
        sep = ", "
    return result