...
AddElement(XMLNodeCurr,'FinInstnId','','',XMLNewChild);
XMLNodeCurr := XMLNewChild;
// Delete the following line.
AddElement(XMLNodeCurr,'BIC',COPYSTR(VendBankAcc."SWIFT Code",1,11),'',XMLNewChild);
// End of the line.
XMLNodeCurr := XMLNodeCurr.parentNode;
XMLNodeCurr := XMLNodeCurr.parentNode;
...
...
AddElement(XMLNodeCurr,'FinInstnId','','',XMLNewChild);
XMLNodeCurr := XMLNewChild;
// Add the following lines.
IF VendBankAcc."SWIFT Code" <> '' THEN
AddElement(XMLNodeCurr,'BIC',COPYSTR(VendBankAcc."SWIFT Code",1,11),'',XMLNewChild)
ELSE BEGIN
AddElement(XMLNodeCurr,'CmbndId','','',XMLNewChild);
XMLNodeCurr := XMLNewChild;
IF VendBankAcc."Clearing Code" <> '' THEN BEGIN
AddElement(XMLNodeCurr,'ClrSysMmbId','','',XMLNewChild);
XMLNodeCurr := XMLNewChild;
AddElement(XMLNodeCurr,'Id',VendBankAcc."Clearing Code",'',XMLNewChild);
XMLNodeCurr := XMLNodeCurr.parentNode;
END;
IF VendBankAcc.Name <> '' THEN
AddElement(XMLNodeCurr,'Nm',VendBankAcc.Name,'',XMLNewChild);
AddElement(XMLNodeCurr,'PstlAdr','','',XMLNewChild);
XMLNodeCurr := XMLNewChild;
IF VendBankAcc.Address <> '' THEN
AddElement(XMLNodeCurr,'AdrLine',VendBankAcc.Address,'',XMLNewChild);
IF VendBankAcc.City <> '' THEN
AddElement(XMLNodeCurr,'AdrLine',VendBankAcc.City,'',XMLNewChild);
AddElement(XMLNodeCurr,'Ctry',VendBankAcc."Country/Region Code",'',XMLNewChild);
XMLNodeCurr := XMLNodeCurr.parentNode;
XMLNodeCurr := XMLNodeCurr.parentNode;
END;
// End of the lines.
XMLNodeCurr := XMLNodeCurr.parentNode;
XMLNodeCurr := XMLNodeCurr.parentNode;
...