toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final cookiesConfig = this.cookiesConfig;
  final headersConfig = this.headersConfig;
  final name = this.name;
  final queryStringsConfig = this.queryStringsConfig;
  final comment = this.comment;
  final $children = <_s.XmlNode>[
    if (comment != null) _s.encodeXmlStringValue('Comment', comment),
    _s.encodeXmlStringValue('Name', name),
    headersConfig.toXml('HeadersConfig'),
    cookiesConfig.toXml('CookiesConfig'),
    queryStringsConfig.toXml('QueryStringsConfig'),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}