If I understand your question, your method will always remain in the DS that its parent is in. Session is just another object and has no affect on the method that created it. You would need to add another line of code to switch to the DS of loSession when creating the cursors.
loSession = createobject( "session" )
lnDSID = loSession.DataSessionID
lnOldDSID = set('datasession')
set datasession to lnDSIDcreate cursor TheRootElement ( ... )
scatter name this.TheRootElement
create cursor ASubordinateElement ( ... )
scatter name this.TheRootElement.ASubordinateElement
set datasession to lnOldDSIDloSession = .null. && poof all the cursors and return to the priv ds
Mark McCasland
Midlothian, TX USA