Problem with If...Else Statements

Hi Everybody
I try to build a form with checkboxes dropdown menus etc. what I will like this code below is if the first checkbox it is check then write the rest of the code , if not go to the next code and don’t consider the line

<td class="alt2" valign="middle">
<input type="checkbox" name="checkboxanswer2" value="$checkboxchoice2" <if condition="$checkboxchoice2 == $checkboxanswer2">checked="checked"</if> /> $checkboxchoice2
<td class="alt2" valign="middle">
<select name="dropdownanswer2">
<option value="$dropdownchoice2a" <if condition="$dropdownchoice2a == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2a</option>
<option value="$dropdownchoice2b" <if condition="$dropdownchoice2b == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2b</option>
<td class="alt2" valign="middle">
<td class="alt2" valign="middle" colspan="3">
<select name="dropdownanswer3">
<option value="$dropdownchoice3a" <if condition="$dropdownchoice3a == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3a</option>
<option value="$dropdownchoice3b" <if condition="$dropdownchoice3b == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3b</option>
next code
next code1
next code2 

this is in xml

I need some help :book:

I hope I wrote this on the right section