the .docx format handles pages in an odd way. At least its odd when you first think about it. After awhile I began to realize that this is probably the best way to do it.
The key concept is that pages don't really exist. Pages are created for visualization purposes only (printing or onscreen display).
Pages do not actually exist in a document's markup.
The xml file you are talking about. The one which contains a page count. This is created by Word.exe every time that it displays a document.
Word figures out the height of each element.
For text this is done using font height.
For elements like Pictures and possibly Charts the height is specified by the element.
Elements like Paragraphs, Cells, Rows and Tables are more complicated because they can contain children elements.
Every element can also specify its own margins, padding's, offsets and other layout specific attributes.
This is why DocX does not manage page numbers. Supporting page numbers is as difficult as building a document viewer (something I have always wanted to do).
So to answer your question. DocX will not update the page count in the internal xml file.
An awful work around would be to get Word.exe to open and re-save a document after you have created/edited it using DocX.
Kind regards and happy coding,