save xml file

I created a XMPPort and codeunit to create the XML file:

I created the report, so that user can prefilter which posted sales invoices ( and lines) wants to export to XML file.

CODE XMLDOMDocument.save(‘C:\Work\XMLInvoice.xml’); creates the file but does not save the information.

Can someone help me what I am doing wrong?

Thank you

S.

-----------------------CODEUNIT CODE --------------
// SalesInvoice
IF NOT CREATE(XMLDOMDocument) THEN
EXIT(261);
SalesInvLine.SETCURRENTKEY(“Document No.”,“Line No.”);
SalesInvLine.SETRANGE(“Document No.”,SalesInvoiceHdr.“No.”);
IF NOT SalesInvLine.FIND(’-’) THEN
EXIT(262);
TempBlob.Blob.CREATEOUTSTREAM(TempOutstream);

SIHExport.SETTABLEVIEW(SalesInvoiceHdr);
SIHExport.SETDESTINATION(TempOutstream);
IF SIHExport.EXPORT THEN BEGIN
TempBlob.Blob.CREATEINSTREAM(TempInstream);
XMLDOMDocument.load(TempInstream);
XMLDOMDocument.save(‘C:\Work\XMLInvoice.xml’);
END ELSE
EXIT(283);

Are you using an XML Port or using the XML DOM?

You say XML Port but then you do instantiation on the XMLDOM with the Create keyword.

t