toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final endPoints = this.endPoints;
  final fields = this.fields;
  final name = this.name;
  final samplingRate = this.samplingRate;
  final $children = <_s.XmlNode>[
    _s.XmlElement(
        _s.XmlName('EndPoints'), [], endPoints.map((e) => e.toXml('member'))),
    _s.XmlElement(_s.XmlName('Fields'), [],
        fields.map((e) => _s.encodeXmlStringValue('Field', e))),
    _s.encodeXmlStringValue('Name', name),
    _s.encodeXmlIntValue('SamplingRate', samplingRate),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}