You can instantiate an instance of the MS Word application via C# and programatically access all of the functions you would via the graphical interface. Your project needs to reference Microsoft.Office.Interop.Word and you must have word installed on the machine this will run on (ie; if it will be deployed on a server, the server needs to have Word installed).
To create the application instance:
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
Open the template document
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(filename); // there are other optional parameters here you can check out
You can then access the doc.CustomXMLParts object, which should give you what you need.