in reply to Re^5: Datastructures to XML
in thread Datastructures to XML

cmd:forkey is specifically for "include this tag/twig" for this/these tag(s). If you want to process all (or all except a few) you'd use cmd:foreachkey.

OTOH, I do assume the list of keys, or at least the list of keys to be handled differently, is known. Like in one of the examples, the {PageId} key is to become the value of the id="" attribute of the <page> tag and all others will end up in the <field> tags.

I assume both the structure of the data and the structure of the XML is known. This is not, "hey, here's some data, serialize it anyhow so that when you deserialize it again, I end up with the same data". It's rather "hey. I have the data in this structure and need to write them to XML in that structure so that they will accept it".