The reason devices always have a parentid of 0 is they can belong to multiple groups. You have to look in the xml of the group itself to see what devices belong to it.
So for instance if you look at the xml for a group called "test" that has 2 devices within you would see 2 items under the "col" branch that represent the device id's (7903989331242 and 293306577447 ). To add more devices to the group you would just add more <u#> branches under the <col> branch for each device you want to include.
Example of <col> branch:
Many thanks Matt,
I knew it had to be there somewhere.