I am not sure of using twin segments in coding........twin segments does mean that they are under same level of a particular parent. you can set a parentage if u want to retrieve the segments and use a GNP calls to retrieve the segments...
if the answer does not satisfy u ........can give the problem description more specific...