Creating HTML on the Fly

   1: new groovy.xml.MarkupBuilder().html {
   2:     head {
   3:         title('Search Results')
   4:         link(rel:'stylesheet' , type:'text/css' , href:'http://main.css')
   5:         script(type:'text/javascript' , src:'http://main.js')
   6:     }
   7:     body {
   8:         h1('Search Results')
   9:         div(id:'results' , class:'simple') {
  10:             table(border:1) {
  11:                 tr {
  12:                     th('Name')
  13:                     th('Address')
  14:                 }
  15:                 tr {
  16:                     td {
  17:                         a(href:'http://abc.org?id=100' ,'Jane Doe')
  18:                     }
  19:                     td('123 Main St')
  20:                 }
  21:             }
  22:         }
  23:     }
  24: }