To use ToC in a pdf using XeTeX compiler I have to compile document twice to get correct table of content and page number.
According to an article about Table of contents one can get a appropriate result in single build by adding -pdf option on latexmk.
Note: For the table of contents to work properly you must compile the document twice or use latexmk -pdf
but unfortunately I can't find equivalent option for XeTeX.
latexmk -xelatex filename.tex. – Torbjørn T. Apr 29 '16 at 13:43