From Word, I did the following:
Insert, Field, IncludeText and pasted the path of one of my php output files with the record id and everything worked perfectly. I did a test preg_replace on the id number and changed it to something else, but I get an error when opening the XML file in Word.
"A text/xml declaration may occur only at the very beginning of input."
My searches have all brought up comments on "white space" for certain headers, but I don't have that issue. My line of code is referenced in the middle of a bunch of junk that looks like this:
JKHSAD897213KJ4HIWUAFYD89876234RGBCE78TBAS877812
Any ideas?