in reply to how to generate html page

Are you sure you want to generate a page like this? It doesn't make any sense to me:

1. you have defined 3 links inside your page, but they look like 9.

2. all of them have the same destination

3. you are talking about "children" and "levels". If "children" are the links inside your page (there are three of them), what are the levels are where are they?

Before you start generating something you should make sure it makes sense.