toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final name = this.name;
  final value = this.value;
  final $children = <_s.XmlNode>[
    if (name != null) _s.encodeXmlStringValue('Name', name),
    if (value != null) _s.encodeXmlStringValue('Value', value),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}