For example, an empty instance of:
<xs:element name="amount" type="xs:string"/>
Still gets serialized as:
This is handled in genx, specifically, genxEndElement(). Currently, it immediately closes the tag if the state is EQUENCE_START_TAG or
SEQUENCE_ATTRIBUTES but not if it's SEQUENCE_CONTENT. Doesn't feel like fixing this at this level will be straightforward, unless we ignore empty content in genxAddText() and similar. But that feels a bit too drastic (this could also be viewed as a feature: if I write content, even empty, I get explicit closing tag).
Alternatively, we could try to handle it at the XSD/e level by not calling genxAddText() for empty simple content.