add xml counter solution in java