toXml method

XmlElement toXml(
  1. String elemName, {
  2. List<XmlAttribute>? attributes,
})

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final event = this.event;
  final events = this.events;
  final id = this.id;
  final queue = this.queue;
  final $children = <_s.XmlNode>[
    if (id != null) _s.encodeXmlStringValue('Id', id),
    if (event != null) _s.encodeXmlStringValue('Event', event.toValue()),
    if (events != null)
      ...events.map((e) => _s.encodeXmlStringValue('Event', e.toValue())),
    if (queue != null) _s.encodeXmlStringValue('Queue', queue),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}