Do not generate form for more than 5 nested elements

It is to avoid recursion errors in PHP