Xpath nth item variable

Does anyone know if we can refer to the results of previous questions Xpaths?

Eg. instead of: instance('csvfile')/root/item[list_name='condition']/name[2]
Something like: instance('csvfile')/root/item[list_name='condition']/name[${previous_question}]
The second example is not working so I am looking for advice on syntax if anyone know Xpaths well.

Turns out it just needs to be written more explicitly:

instance('csvfile')/root/item[list_name='condition']/name[position() = ${previous_question}]