i m on D6. what I tried is 
1. get the folder object
2. retrieve all its relationships with target role as Relationship.ROLE_CHILD . 
3. get the target object's ids. 
 i thought when i add a parent-child relationship to a document object, a new relationship is also added to the target folder object as well. it seems to be wrong. 
 does anyone know a good way to solve this problem?  if i have to go by query, how would it look like?  
 
-ossa