Visible text

The visible text of a node depends on the kind of node.

The visible text of a text node is:

The visible text of an element is:

The visible text of any other node is the concatenation of the visible text of its children (in tree order in the flat tree).