I had to generate a table of contents based on the contents of an article. So what´s the smiplest way? I had two ways to go: Parse the HTML (should be XHTML, which allows me to use an XMLDocument for example), but it could also be ugly HTML. Read the DOM with javascript and generate links for each header...