2: Support nested elements 

Remove unused member
2: Support nested elements 

Rename variable
2: Support nested elements 

Reintroduce needed member: 'parent' in Template class.
Update currentTemplate on en element.
2: Support nested elements 

Extend test case.
2: Support nested elements 

Rename method
2: Support nested elements 

Rename parameter. Add comment.
2: Support nested elements 

Remove duplicated code.
2: Support nested elements 

Extend error message.
2: Support nested elements 

Extend error message