xml := BtbXmlRenderer on: writeStream.
xml render: #(first arg1: 'value1' arg2: 'value2'
(second (third '"fun"'))
(fifth #sixth: 56)).
And this generates the following XML:
<first arg1="value1" arg2="value2">
I made all objects implement #renderXMLOn: so that I can use Arrays, Blocks, or anything else to make it easier to output XML in the future. It also means I can use all three approaches to generate one XML document. I think this is a perfect example of polymorphism and the power of dynamic languages at its finest. So, we have three ways of generating XML and I found that each has its advantages at different times. My point to this post was to show yet another way to generate XML using Smalltalk. Keep the Smalltalk flowing!