Yes, below I have demonstrated two approaches which can be used for passing variables into an Xpath Query so that you can identify an object. In the examples the sample code below shows two different ways you could query each element of a HTML table to return the Text Contents of the table rows.

1) Approach one demonstrates how to pass an integer value (Index) to an Xpath query so that so that the Open Agent will find the nth object which is a child of the current object in context. Please view the SilkTest help under Supported XPath Subset for more details on using Indexing.

[-] testcase one () appstate none
 [ ] INTEGER i
 [ ] STRING st
 [-] for (i=1; i<=20; i++)
  [ ] st = Desktop.Find("/BrowserApplication//BrowserWindow//TD[{i}]").GetText()
  [ ] print(st)

2) Approach two demonstrates how to pass a String value (if known) of an  attribute which identifies each table row. It is important to know that apart from using approach one to identify the object by its Index, that you can only pass STRING variables into an Xpath query in order to identify a control. The sample code below shows you how you can identify each row of a table by using the text controls specified in an Array data type.
[-] testcase two () appstate none
 [ ]
 [ ] ARRAY[50] OF STRING array1 = {"1000","1001","1002","1003","1004","1005"}
 [ ] int i = 1
 [-] for (i =1; i<6; i++)
  [ ] Print(Desktop.Find("/BrowserApplication[1]//BrowserWindow//TD[@textContents='{array1}']").GetText())

The key to adding a variable to the actual string xPath query is to use the { } brackets.