Below is the sample piece of code for submitting the variable into XPath.
Selenium IDE
<tr>
<td>store</td>
<td>2</td>
<td>a</td>
</tr>
Verify the A value
<tr>
<td>echo</td>
<td>${a}</td>
<td></td>
</tr>
//Replace the hardcoded value with a
<tr>
<td>click</td>
<td>//*[@id='ctl00_Main_DropDown']/div/ul/li[${a}]</td>
<td></td>
</tr>
In Selenium RC
String a = "2";
System.out.println(a);
selenium.click("//*[@id='ctl00_Main_DropDown']/div/ul/li[" + a + "]");
Selenium IDE
<tr>
<td>store</td>
<td>2</td>
<td>a</td>
</tr>
Verify the A value
<tr>
<td>echo</td>
<td>${a}</td>
<td></td>
</tr>
//Replace the hardcoded value with a
<tr>
<td>click</td>
<td>//*[@id='ctl00_Main_DropDown']/div/ul/li[${a}]</td>
<td></td>
</tr>
In Selenium RC
String a = "2";
System.out.println(a);
selenium.click("//*[@id='ctl00_Main_DropDown']/div/ul/li[" + a + "]");