New tag processing algorithm to support nested set/get tags