A better implementaion of the XML renderer