I take it you're doing this in a 10.x or early 11.x version? Your code works in 11.4, so I'd suggest some additional logging:
when XML_CONTENT_BASED_ROUTING {
log local0. "here"
for { set i 0 } { $i < $XML::count } { incr i } {
set id $XML::values($i)
log local0. "Current ID = $id"
if { ( [matchclass $XML::values($i) equals DataGroup_by_Org] ) } {
log local0. "Sending to pool_A"
pool pool_A
} else {
log local0. "Sending to pool_B"
pool pool_B
}
}
}
when LB_SELECTED {
log local0. "here: [LB::server addr]"
log local0. "3189: orgName $id sent to [LB::server addr]"
}
Can you report back what you get in the logs?