I have a simple list n=74 codes which I read using the regular ROOT and SUB template expression: {fme:get-attribute("code")} but because of a nested comparison, they are nested as shown below. I get errors for the missing closing tags (</inv:And>) and If I pre-fill the closing tags, I get an error because they do not match the opening tags.
This is perfect for a recursive loop, but a function would be needed within the xmlTemplater? or a script? or 2 loops one for the top half and another for the bottom half? Below is the end result (partial code) of the desired end result. I can manually add the last code <code>code n</code>. The rest is symmetrical. FME desktop 2018.
Addition: terribly sorry I did not mention that code is a string.