Lately, I become more and more interested in
domain specific languages (DSL). A great example for a DSL is
XML builder for ruby.
Ruby on Rails ships with it and you can use it in .rxml templates. Builder allows you to create xml files without much coding. Furthermore the coding you have to write looks like a custom language but its just plain ruby code. I use builder to generate the RSS feed of this site. Since it took me a while to find out how I can add the RDF namespace here is the code:
As you can see you generate tags by writing xml.<tagname>(content). Furthermore with the help of blocks builder is able to know when it has to open and close tags. So 15 lines of code for generating a rss feed, not bad ;)