Please consider this XML:
10 20
select @xml.value('sum(/Parent[@ID = "p"]/Child)', 'float') as Sum
The use of float protects against there being no Parent with that ID. You can then cast this result to int.
float
Parent
ID
int