I want to see my .docx in its pure XML format.
Various application like internet browsers and visual studio will open the file up in Word for me.
I've also tried renaming the document to .xml extension and it just opens up in notepad showing a bunch of unintelligible text.
word/document.xmlfile beneath it. – Aidan Feldman May 25 '16 at 03:22WordprocessingDocument, use ausing (StreamReader sr = new StreamReader(wordDoc.MainDocumentPart.GetStream()) { string docText = sr.ReadToEnd(); }That gets the XML to load into a string, then use aXMLDocument& modify theXMLNodesthat you can grab/remove/modify values of/insert new ones, etc.xmlDoc.LoadXml(docText); XmlNodeList nodes = xml.GetElementsByTagName("w:body"); XmlNode bodyNode = nodes[0]; XmlNode firstParagraph = bodyNode.ChildNodes[2];. WritedocText = xml.OuterXml;– vapcguy Nov 15 '18 at 02:45using (StreamWriter sw = new StreamWriter(wordDoc.MainDocumentPart.GetStream(FileMode.Create))) { sw.Write(docText); }to write your changes back out. – vapcguy Nov 15 '18 at 02:46[Content_Types].xmlmust be at the root of the zip file – phuclv Dec 12 '18 at 08:58