toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final days = this.days;
  final mode = this.mode;
  final years = this.years;
  final $children = <_s.XmlNode>[
    if (mode != null) _s.encodeXmlStringValue('Mode', mode.toValue()),
    if (days != null) _s.encodeXmlIntValue('Days', days),
    if (years != null) _s.encodeXmlIntValue('Years', years),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}