newDocumentContent function
Implementation
XmlDocument newDocumentContent(String content) {
if (content.isEmpty || content.trim().isEmpty) {
throw const FormatException('Received xml string argument is empty');
}
try {
final documentParse = XmlDocument.parse(content);
return newDocument(documentParse);
} on Exception catch (e) {
throw FormatException(
'Cannot create a Document from xml string, error: $e',
);
}
}