toXml method

String toXml()

Converts this object to an XML string.

Uses xmlBuilder to serialize the result of toJson(). Throws an UnimplementedError if xmlBuilder is not provided.

Implementation

String toXml() {
  if (xmlBuilder == null) throw UnimplementedError();
  return xmlBuilder!(toJson());
}