toXml method

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

Implementation

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