XML-like Type Signatures can define rendering logic quickly by using the xrender macro. This macro defines a Display implementation for the given type.
rdxl_rss/src/lib.rs
xrender!(Rss,{{format!(r#"<?xml version="{}" encoding="{}" ?>"#,self.xml_version,self.xml_encoding)}}<rss version={{self.version}}>{{for c inself.children.iter(){{{{letRssChildren::RssChannel(c)= c;}}<channel>{{for rc in c.children.iter(){{{{ifletRssChannelChildren::RssChannelTitle(t)= rc {{<title>{{ t.title }}</title>}}elseifletRssChannelChildren::RssChannelDescription(t)= rc {{<description>{{ t.description }}</description>}}elseifletRssChannelChildren::RssChannelLink(t)= rc {{<link>{{ t.link }}</link>}}elseifletRssChannelChildren::RssChannelLastBuildDate(t)= rc {{<lastBuildDate>{{ t.date }}</lastBuildDate>}}elseifletRssChannelChildren::RssChannelPubDate(t)= rc {{<pubDate>{{ t.date }}</pubDate>}}elseifletRssChannelChildren::RssChannelTTL(t)= rc {{<ttl>{{ t.ttl }}</ttl>}}elseifletRssChannelChildren::RssItem(t)= rc {{<item>{{for ic in t.children.iter(){{{{ifletRssItemChildren::RssItemTitle(c)= ic {{<title>{{ c.title }}</title>}}elseifletRssItemChildren::RssItemDescription(c)= ic {{<description>{{ c.description }}</description>}}elseifletRssItemChildren::RssItemLink(c)= ic {{<link>{{ c.link }}</link>}}elseifletRssItemChildren::RssItemGuid(c)= ic {{<guid isPermaLink={{ c.is_permalink }}>{{ c.guid }}</guid>}}elseifletRssItemChildren::RssItemPubDate(c)= ic {{<pubDate>{{ c.date }}</pubDate>}}}}}}}}</item>}}}}}}}}</channel>}}}}</rss>);