xmlFromResponse function
Implementation
Future<XmlElement> xmlFromResponse(StreamedResponse rs,
{String? resultWrapper}) async {
final body = await rs.stream.bytesToString();
if (body.isNotEmpty) {
var elem = XmlDocument.parse(body).rootElement;
if (resultWrapper != null) {
elem = elem.findElements(resultWrapper).first;
}
return elem;
} else {
return XmlElement(XmlName('empty'));
}
}