def etree_last_child(elem):
    """Returns the last child of the element, ignoring children that are lxml comments."""
    for child in reversed(elem):
        if not callable(child.tag):
            return child
