You can use the count XPath expression on the values of the group1:
count(dfs:dataFields/my:SharePointListItem_RW../my:group1/Value)
However it seems it always return +1 so you should change above expression to:
count(dfs:dataFields/my:SharePointListItem_RW../my:group1/Value) - 1