Hello JackSony,
The page number is an artefact of paginated publishing, and as much a layout thing as "14pt, Times New Roman" is. Even if it was possible to include page numbers in the XML, one shouldn´t: The main reason to use XML is to separate content/structure from layout.
To achieve the page number display you are talking about, you could do either one thing:
1. In the final FM source, from which you wan´t to produce PDF, edit the master pages to contain a cross reference to a cross reference marker that sits on the last page of the last file of your book that is to be published to PDF. This way, the "Y" in "page X of Y" gets updated properly. Mind: If you last file is an Index, it is not enough to put the cross reference marker into the Index heading. If the index has more than one page, this is not the last page. To avoid this, you might add a last chapter file to your book after the index, that says "this page is intentionally left blank" or something and contains the cross reference marker.
2. You might use TOOLBOX, a plugin collection for FrameMaker. This plugin collection contains a plugin for that: On your master pages you use a special variable called "LastPage". When started, the plugin determines the last page number and fills it into the variable.
You find more information on the following page (trial download):
http://www.systec-gmbh.com/en/sites/downloads_epub.php
In there theres documentation that describes all modules of TOOLBOX.
Hope this helps.
With kind regards,
Franz.
[ excess signature removed by host ]