def plain_text(node):
    """
    Return the plain text of a node with all tags ignored.

    This is needed where Doxygen may include refs but Sphinx needs plain text
    because it parses things itself to generate links.
    """

    if node.tag == "sp":
        markup = " "
    elif node.text is not None:
        markup = node.text
    else:
        markup = ""

    for child in node:
        markup += plain_text(child)
        markup += child.tail if child.tail is not None else ""

    return markup