writeValueAsXmlMap method
Serializes a Dart object into an XML Map<String, dynamic> representation.
This method traverses all serializable fields of value and produces
a nested map structure compatible with XML generation.
Example
final map = mapper.writeValueAsXmlMap(user);
print(map['user']['id']); // 1
Implementation
@override
Map<String, dynamic> writeValueAsXmlMap(Object? value) {
if (value == null) return {};
final xmlString = writeValueAsXml(value);
return utils.XmlParser().parse(xmlString);
}