[xml] Cleaner way to display trees in XML files

Make use of UIModules instead of tricks using call to raw methods that render a string given the object and a context.