File Corruption & Recovery

Repair Word's document.xml White Space Expected Error

Bushra ParveenBushra Parveen Nov 27, 2026 868 views

Question details

Repair or recover a Word document that reports a malformed XML error at a specific location in /word/document.xml.

Repair Word's document.xml White Space Expected Error
Product
Microsoft Word
Device & OS
not provided
Scenario
The user needs to open and recover the contents of a DOCX file that reports a white space error.
Observed behavior
Word reports "White space expected" in /word/document.xml at a specific line and column.
Before you start

Find the original DOCX file and note the line and column reported by Word. Check that the file is a genuine DOCX, not an older DOC file that was renamed with a .docx extension.

Solution 1Recommended

Use Word's Open and Repair Command

Try Word's built-in repair option before editing the document's internal XML.

1
Open the file picker

In Word, select File > Open > Browse and locate the affected DOCX file.

2
Run the repair

Select the file, click the arrow next to Open, and choose Open and Repair.

3
Save recovered content

If the document opens, check its contents and use File > Save As to save it under a new name.

Use Word's Open and Repair Command
Repair may be incomplete: Open and Repair may not recover every page or fix every malformed XML error.
Free Microsoft Office alternative

Work With Word Documents in WPS Writer

WPS Office is a free, lightweight alternative with a familiar interface for working with compatible Word documents. Open a recovered DOCX or an earlier copy in WPS Writer; it does not guarantee repair of malformed XML.

Open and edit recovered Word documents in WPS WriterCompatible with Microsoft Word DOC and DOCX formatsUse a familiar interface to make migration easierWork with a lightweight office suite available for free
microsoft office alternative - wps office

Frequently Asked Questions

What does "White space expected" in document.xml mean?

It means the XML parser encountered invalid syntax, such as missing whitespace between parts of a tag. The line and column in Word's message help you locate the surrounding markup in word/document.xml.

Can I fix the file by changing DOC to DOCX?

No. Renaming the extension does not convert an older DOC file into the ZIP-based DOCX format. Open a valid DOC in Word and use File > Save As to convert it, or find the original DOCX.

Why does the file show gibberish in a text editor?

DOCX files are ZIP-based packages, not plain text documents. Open a copy as a ZIP and inspect word/document.xml with an XML editor instead of opening the entire DOCX as text.

What can I do if Open and Repair recovers only some pages?

Check OneDrive or SharePoint Version history, backups, email attachments, and shared folders for an earlier copy. You can also consider a document recovery service, although full recovery is not guaranteed.

How should I package the XML files after editing?

Create a ZIP with the extracted DOCX contents at the ZIP root, including [Content_Types].xml and the word and _rels folders. Rename the ZIP extension to .docx, then test it in Word.