def get_tei_element_for_semantic_content(self, semantic_content: SemanticContentWrapper, context: TeiElementFactoryContext) -> etree.ElementBase:
    LOGGER.debug('semantic_content: %s', semantic_content)
    assert isinstance(semantic_content, SemanticHeading)
    semantic_heading = semantic_content
    children: T_ElementChildrenList = [context.get_default_attributes_for_semantic_content(semantic_heading)]
    pending_whitespace = ''
    for child_semantic_content in semantic_heading:
        if isinstance(child_semantic_content, SemanticLabel):
            children.append({'n': child_semantic_content.get_text()})
            continue
        layout_block = child_semantic_content.merged_block
        if pending_whitespace:
            children.append(pending_whitespace)
        children.extend(context.iter_layout_block_tei_children(layout_block=layout_block, enable_coordinates=False))
        pending_whitespace = layout_block.whitespace
    return TEI_E('head', *children)
def get_tei_element_for_semantic_content(self, semantic_content: SemanticContentWrapper, context: TeiElementFactoryContext) -> etree.ElementBase:
    LOGGER.debug('semantic_content: %s', semantic_content)
    assert isinstance(semantic_content, SemanticHeading)
    semantic_heading = semantic_content
    children: T_ElementChildrenList = [context.get_default_attributes_for_semantic_content(semantic_heading)]
    pending_whitespace = 
    for child_semantic_content in semantic_heading:
        if isinstance(child_semantic_content, SemanticLabel):
            children.append({'n': child_semantic_content.get_text()})
            continue
        layout_block = child_semantic_content.merged_block
        if pending_whitespace:
            children.append(pending_whitespace)
        children.extend(context.iter_layout_block_tei_children(layout_block=layout_block, enable_coordinates=False))
        pending_whitespace = layout_block.whitespace
    return TEI_E('head', *children)