This error looks like UI5 is trying to load the pre-processor directives as if they were controls. Because controls are not yet loaded during pre-processing, I guess that this happens during view control tree instantiation. This in turn indicates that the template instructions were still present in the XML view at the moment when the control tree was built.
Are you sure you actually have "activated" XML pre-processing before instantiating your view? Check out the XML pre-processing documentation (more specifically, the "calling the preprocessor" example).
Actually, now that I am reading your question again, I think you want to use XML pre-processing instructions for building the UI based on your data. This should not be the case, you should use XML pre-processing / templateing only for building the views based on your meta-data (i.e. only once, the first time the view is shown).
For adapting your views based on your data, you should use data binding instead. More specifically, you should use aggregation binding to emulate a loop.