toXml method

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

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final delimiter = this.delimiter;
  final maxDepth = this.maxDepth;
  final minStorageBytesPercentage = this.minStorageBytesPercentage;
  final $children = <_s.XmlNode>[
    if (delimiter != null) _s.encodeXmlStringValue('Delimiter', delimiter),
    if (maxDepth != null) _s.encodeXmlIntValue('MaxDepth', maxDepth),
    if (minStorageBytesPercentage != null)
      _s.encodeXmlDoubleValue(
          'MinStorageBytesPercentage', minStorageBytesPercentage),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}