2.1.4 [XML] Section 3, Logical Structures
Validity constraint: Element Valid An element is valid if there is a declaration matching elementdecl where the Name matches the element type, and one of the following holds: 1. The declaration matches EMPTY and the element has no content (not even entity references, comments, PIs or white space). 2. The declaration matches children and the sequence of child elements belongs to the language generated by the regular expression in the content model, with optional white space, comments and PIs (i.e. markup matching production  Misc) between the start-tag and the first child element, between child elements, or between the last child element and the end-tag. Note that a CDATA section containing only white space or a reference to an entity whose replacement text is character references expanding to white space do not match the nonterminal S, and hence cannot appear in these positions; however, a reference to an internal entity with a literal value consisting of character references expanding to white space does match S, since its replacement text is the white space resulting from expansion of the character references.
MSXML3 and MSXML6
A CDATA section is valid if it contains white space only or if it contains a reference to an entity whose replacement text is character references that expand to white space.
An element with a declaration that matches EMPTY is valid if it contains comments, processing instructions, and entity references. All comments, processing instructions, and entity references are resolved to empty strings.
An element with a declaration that matches EMPTY is valid if it contains entity references. Entity references are resolved to empty strings.