converting values to an xml string with jquery using getElementById

converting values to an xml string with jquery using getElementById

In standard JS this is easy, how would I get the function correct in jquery?    
function SetServices() {
            var services = '';
            if (document.getElementById('CBT1').checked == true) {
                services = services + '<SERVICE><SERVICECD>CBT1</SERVICECD></SERVICE>';
            }
            document.getElementById('SERVICES').value = '<SERVICES>' + services + '</SERVICES>';
        }
then I use this on checkboxes -  onclick="SetServices();"

I keep getting syntax errors  when I try and do this with jquery
$(document).ready(function() {
      var services = '';
      if($('#CBT1').is(":checked")) {
            services = services + '<SERVICE><SERVICECD>CBT1</SERVICECD></SERVICE>';
      }
not sure where to begin on the last part
});

Im stringing the values into an xml string, works fine in standard js.
Thanks,


Kane Leins