Thanks Sean Hill for your answer.
Really appreciate.
Actually as mentioned in the question, My concern is not creating the TOC, it does appear after compilation, but at times the it doesn't appear the same as created in the tool.
The books and sub topics gets jumbled up.