Now we want to generate a table with a line for each attribute defined on a UML Class:

You can see the attributes are linked to their class with the reference attribute. The doc template has to iterate on the attribute list and add a line in a table:
At this stage, the template should look like this:
...
Classes
[#foreach class in model.getInstances("Class")]
Class
${class.name}
Description
[#foreach comment in class.ownedComment]
${comment.body}[/#foreach]
This is an abstract class
[#if class.isAbstract]
[/#if]
Attributes
| Name | Type |
[/#foreach]
We want to add a foreach tag that embraces the whole line, so that a line creation is part of the foreach iteration.
...
Attributes
| Name | Type |
[#foreach attr in class.attribute]
${attr.name}
|
[/#foreach]
|
[/#foreach]
Save the doc template, relaunch the generation and open the file result.xml:
...
Class Order
Description
An order of a product by a customer
Attributes
| Name | Type |
| date | |
| items | |
| product |