The correct XPath in this situation is:
Since you are in
context within the
, you must go up one level and fetch the
from there. Your try
/Promotions/Promotion[Category=$category]/ID
fetches all
s of a certain category and takes the first ID from the bunch, which is the same every time, naturally.