Perhaps are you using FME 2016? Since FME 2016 treats the value of "_element_count" as a string, you will have to explicitly convert it to integer in the expression like this.
let $n := xs:integer(fme:get-attribute("_element_count")) - 1
My previous example was to repeat <CharacterString> element within a single parent element, but looks like it would not match your desired result. If you need to repeat <column> element which contains <name> and <type> elements as its descendants, this example might be better for you. Assuming that the input feature has a list attribute called "attr{}.name", "attr{}.type".
<parent>{
let $n := xs:integer(fme:get-attribute("_element_count")) - 1
for $i in (0 to $n)
let $aname := "attr{"||$i||"}.name"
let $atype := "attr{"||$i||"}.type"
return
<column>
<name>
<CharacterString>{fme:get-attribute($aname)}</CharacterString>
</name>
<type>
<CharacterString>{fme:get-attribute($atype)}</CharacterString>
</type>
</column>
}</parent>
input:
attr{}.name contains "foo", "bar", and "foobar"
attr{}.type contains "string", "integer", and "double"
result:
<?xml version="1.0" encoding="UTF-8"?>
<parent>
<column>
<name>
<CharacterString>foo</CharacterString>
</name>
<type>
<CharacterString>string</CharacterString>
</type>
</column>
<column>
<name>
<CharacterString>bar</CharacterString>
</name>
<type>
<CharacterString>integer</CharacterString>
</type>
</column>
<column>
<name>
<CharacterString>foobar</CharacterString>
</name>
<type>
<CharacterString>double</CharacterString>
</type>
</column>
</parent>