$ awk '{
for (i=1;i<NF;i+=2) {
sum[$i]+=$(i+1)
}
ofs = ""
for (key in sum) {
printf "%s%s %d)", ofs, key, sum[key]
delete sum[key]
ofs = OFS
}
print ""
}' file
(X2 99) (X3 39) (X1 58)
(X3 11) (X1 30)
If you care about the order of the fields, there's various ways to keep the original order...