In Word 2003, one can embed the content of the word document in to different XML elements that is defined by XML schema that extends the default World XML schema. Effectively one could write document contents in a word documents and tag contents as XML and then save the document as XML. Word validates the document against the XML schema and on successful validation, the word document can be saved as XMLdocument with .xml extension. Any application that wants to process the contents of the document can now READ it as XML document and process the same.
To learn more, one can look at Word 2003: XML Toolbox. For this to work properly, .Net framework 1.1 was needed.
Today I learnt about Word 2007 internals from an old MSDN article. In Word 2007, the top-level file (.docx) is known as a package. Since a package is implemented as a standard ZIP archive, it automatically provides compression and it makes its contents instantly accessible to many existing utilities and APIs on both Windows platforms and other platforms alike. Applications with Word 2007 can also start writing in to a file stream in a Open XML format and save the stream to the file system in the machine. You can write it back to an ASP.Net client using the OutputStream object of the ASP.NET Response object(use a MemoryStream object instead of a physical file) and writing the appropriate HTTP headers.