When the user agent claims to support facilities defined within this
specification or required by this specification through normative
reference, it must do so in ways consistent with the facilities'
definition.

If it encounters an entity reference (other than one of the predefined
entities) ... the entity reference should be rendered as
the characters (starting with the ampersand and ending with the
semi-colon) that make up the entity reference.

When rendering content, user agents that encounter characters or
character entity references that are recognized but not renderable
should display the document in such a way that it is obvious to the
user that normal rendering has not taken place.

(When the 'xml:space' attribute is not set to
'preserve', then)
LINE FEED characters must be converted into one of the following
characters: a SPACE character, a ZERO WIDTH SPACE character
(&#x200B;), or no character (i.e. removed).

(When the 'xml:space' attribute is not set to
'preserve', then)
A sequence of white space characters with one or more LINE FEED
characters must be reduced in the same way as a single LINE FEED
character.

All line breaks must have been normalized on input to #xA as described
in 2.11 End-of-Line Handling, so the rest
of this algorithm operates on text normalized in this way.

Begin with a normalized value consisting of the empty string.

For each character, entity reference, or character reference in the
unnormalized attribute value, beginning with the first and continuing to the
last, do the following:

For a character reference, append the referenced character to the normalized
value.

For an entity reference, recursively apply step 3 of this algorithm
to the replacement text of the entity.

For a white space character (#x20, #xD, #xA, #x9), append a space character
(#x20) to the normalized value.

For another character, append the character to the normalized value.

If the attribute type is not CDATA, then the XML processor must further
process the normalized attribute value by discarding any leading and trailing
space (#x20) characters, and by replacing sequences of space (#x20) characters
by a single space (#x20) character.