toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final date = this.date;
  final days = this.days;
  final expiredObjectDeleteMarker = this.expiredObjectDeleteMarker;
  final $children = <_s.XmlNode>[
    if (date != null)
      _s.encodeXmlDateTimeValue('Date', date, formatter: _s.iso8601ToJson),
    if (days != null) _s.encodeXmlIntValue('Days', days),
    if (expiredObjectDeleteMarker != null)
      _s.encodeXmlBoolValue(
          'ExpiredObjectDeleteMarker', expiredObjectDeleteMarker),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}