...
try
newNode := Factura.RegistroFacturacion.ObjectToSOAP( ARootNode, ARootNode, MOPToSoapDomConvert, 'RegistroFacturacionType',
Swdsl,'T',[ocoDontPrefixNode,ocoDontPutTypeAttr], RefId );
XML.DocumentElement := ARootNode;
XML.XML.SaveToFile('RegistroFacturacion.xml',TEncoding.UTF8);
XML.Active := False;
Except
On E : Exception do Begin
Showmessage(E.Message);
XML.DocumentElement := ARootNode;
XML.XML.SaveToFile('RegistroFacturacionError.xml',TEncoding.UTF8);
XML.Active := False;
End;
...