There is no universal model, but what you are looking for is essentially a template solution - a template language and a template evaluation engine that converts a template to final XML by executing the code embedded in the template.
, , .
- , , , ; . . JSP Java, EmbPerl Perl, XSLT ..
EmbPerl:
[$ foreach my $i (1..5) $]
<frame>
<image>./image[+$i+].png<image/>
</frame>
[$ endforeach $]
, , , (Perl vs. Java vs. xxx)
homebrew-, , , XML, -
<frameset min=1 max=5>
<image part=1 conent_type="constant">./image<image/>
<image part=2 conent_type="iterator_value"><image/>
<image part=3 conent_type="constant">.png<image/>
</frameset>