Imagine we have a schema with a compex element that has all optional children and data where the none of the children exist. Or a similar case where all the children of a complex element are hidden. In such cases, the XMLTextInfosetOutputter will output something like this:
To a non-schema aware XML parser, complex_with_no_children will look like a simple type with whitespace content instead of an empty complex type, which can cause problems.
Instead, the XMLTextInfosetOutputter should detect when a complex element will not have any text output (i.e. no children, or all children are hidden), and instead output an element with no content , so the above should look more like: