Why don't you use the @ template instead of x and X?
In reply to Re^2: Challenge: Construct an unpack string by ambrus in thread Challenge: Construct an unpack string by holli