AbstractOptionalincludeIfEmpty: booleanAdds a child element to this component.
The child component or text string to add
This component (for chaining)
Prepares the component for XML serialization, excluding it if empty.
The serialization context
The XML-serializable object, or undefined if empty
XML component that is excluded from output if it has no meaningful content.
IgnoreIfEmptyXmlComponent is useful for optional container elements that should only appear in the XML if they contain children or attributes. If the element would be empty, it returns undefined instead, causing it to be excluded from the output.
Example