Add variable in xpath

This has been asked many times on this forum, like the below question: