buildEvents method
Builds the XML events for this element.
Implementation
List<XmlEvent> buildEvents(String indent) {
return [
for (final comment in [...?comments]) ...[
XmlTextEvent('\n$indent'),
XmlCommentEvent(comment),
],
XmlTextEvent('\n$indent'),
XmlStartElementEvent(
name,
[
for (final entry in attributes.entries)
XmlEventAttribute(
entry.key,
entry.value,
XmlAttributeType.DOUBLE_QUOTE,
),
],
isSelfClosing,
),
if (content != null) XmlTextEvent(content!),
if (!isSelfClosing) XmlEndElementEvent(name),
];
}