Stefano,
It is always possible (and adviseable) to sub-divide your templates. Here, instead of appending in a file for every new UseCase you come across, you could use a loop :
[template public generate(p : Package)]
[comment @main/]
[file (('useCases.html'), false)]
<html>
<body>
[for (uc : UseCase | p.eAllContents(UseCase))]
[generateUseCase(uc)/]
[/for]
</body>
</html>
[/file]
[/template]
[template public generateUseCase(uc : UseCase)]
<h1>UseCase: [uc.name/]</h1>
[if (uc.ownedBehavior->notEmpty())]
<h5>Part of Activity: [uc.ownedBehavior.name/]</h5>
[/if]
<h3>Extension Points:</h3>
[if (uc.extensionPoint->isEmpty())]
<p>No Extension Points</p>
[/if]
<ul>
[for (e : ExtensionPoint | uc.extensionPoint)]
<li>[e.name/]</li>
[/for]
</ul>
[/template]
Please note that using "eAllContents" as I did here is far from efficient, you might want to manually navigate to your list of use cases instead.