toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final errorCode = this.errorCode;
  final errorCachingMinTTL = this.errorCachingMinTTL;
  final responseCode = this.responseCode;
  final responsePagePath = this.responsePagePath;
  final $children = <_s.XmlNode>[
    _s.encodeXmlIntValue('ErrorCode', errorCode),
    if (responsePagePath != null)
      _s.encodeXmlStringValue('ResponsePagePath', responsePagePath),
    if (responseCode != null)
      _s.encodeXmlStringValue('ResponseCode', responseCode),
    if (errorCachingMinTTL != null)
      _s.encodeXmlIntValue('ErrorCachingMinTTL', errorCachingMinTTL),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}