toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final errorDocument = this.errorDocument;
  final indexDocument = this.indexDocument;
  final redirectAllRequestsTo = this.redirectAllRequestsTo;
  final routingRules = this.routingRules;
  final $children = <_s.XmlNode>[
    if (errorDocument != null) errorDocument.toXml('ErrorDocument'),
    if (indexDocument != null) indexDocument.toXml('IndexDocument'),
    if (redirectAllRequestsTo != null)
      redirectAllRequestsTo.toXml('RedirectAllRequestsTo'),
    if (routingRules != null)
      _s.XmlElement(_s.XmlName('RoutingRules'), [],
          routingRules.map((e) => e.toXml('RoutingRule'))),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}