Remove certain values from xml string if checkbox clicked
<p>I have form that builds an xml string of all the values (excluding some) in the submitHandler of an .ajax submitted form to a WCF service, here is an example:</p>

<pre><code>function SetServices() {        
    var services = '&lt;SERVICE&gt;&lt;SERVICECD&gt;1KNTK&lt;/SERVICECD&gt;&lt;/SERVICE&gt;';
$(":checked:not([name='ServiceType'], #Standard, #NoneForex, #RTT, #PRN, #BW, #Metrics, #STATUS :input, #EX_AGREEMENTS :input, #final_step :input)").each(function() {
services += '&lt;SERVICE&gt;&lt;SERVICECD&gt;' + this.id + '&lt;/SERVICECD&gt;&lt;/SERVICE&gt;';
});
$('#SERVICES').val('&lt;SERVICES&gt;' + services + '&lt;/SERVICES&gt;');            
}
SetServices();
</code></pre>

<p>I need to add a function that will remove some values (var dontsubmit = ("#id1, #id2") etc if a checkbox ("#CME") is checked how would I combine this with the function "SetServices" or do I just run it after in the submitHandler?</p>

<pre><code>$("#CME").change (function() {
    var dontsubmit = ("#id1, #id2, #id3, #id4, #id5");
    if ($(this).is(":checked") &amp;&amp; dontsubmit.is(":checked") {
    $(this).remove(dontsubmit);
});
</code></pre>

<p>this isnt working, I need to figure out how to remove from the string "SetServices" builds.</p>
