Generated DOCX/XPS documents are corrupted or causes problems

We have problems with generated docx or xps files using the Aspose.Words 9.2 evaluation version.
Our process:

loading a document tamplate(e.g doc or docx file) mailmerge some fields save the document in a memory or file stream in different output formats: doc, pdf, docx, xps
The generated docx or xps files causes problems. Office 2010 shows a dialog, that the document is corrupted or the contant causes problems.
Attached you will find the generated docx-file.
i hope you can help an have a solution.
code example:

// Get Document Template
Aspose.Words.Document doc = new Aspose.Words.Document(docTemplate.GetFile());

// MailMerge for all fields
doc.MailMerge.Execute(dt.Rows[0]);

SaveFormat docFormat = (SaveFormat) Enum.Parse(typeof(Aspose.Words.SaveFormat), fileType, true);
// copy document into transfer structure
MemoryStream memStream = new MemoryStream();
doc.Save(memStream, docFormat);
// ... save document in database or filesystem

Hi

Thanks for your inquiry. I suppose, the problem occurs when you save document in database or filesystem. As I can see at the end of the file where are 8861 additional zero-bytes. If remove these additional zero-bytes, the document can be successfully opened by MS Word.
Please check your code. Also, you can attach your code here and I will check it.
The following article might be useful for you:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/
Best regards,