XML – adding new line

calendar_today Asked Nov 7, 2012
thumb_up 19 upvotes
history Updated April 16, 2026

Question posted 2012 · +7 upvotes

I have MS word doc saved as .docx. I want to insert new line in my text by edditing XML file of docx. I have already tried 
, 
, 
, 	, amd it always gives me only space not a new line.

what it does:

(XML code) <w:t>hel&#xA;lo</w:t>

When I open .docx file then it is changed to:

Hel lo not as I wanted to be Hel on one line and lo on secound line.

Accepted answer +19 upvotes

Use the <w:br/> tag.

I found it by creating a Word document, saving it as XML (via Save As), adding a forced line break with Shift Enter, and checked out the change. The essential difference seems to be just the w:br tag, apparently reflecting the HTML br tag.

Top ms-word Q&A (6)

+19 upvotes ranks this answer #1 out of 31 ms-word solutions on this site — top 3%.