It would be helpful to see your code. Assuming that the data is stored in some hierarchical representation, the recursion structure may look like this:
void PrintTOC(string prefix, List<Sections> sections) {
for(int i = 0; i<sections.Length; i++) {
string num = String.Format("{0}.{1}", prefix, i+1);
Console.WriteLine("{0} {1}", num, sections[i].Titles);
if (sections[i].Children != null)
PrintTOC(num, sections[i].Children);
}
}
, . .