Stream variable ID in trees