The limit of DataTree and Data matching?

Hi, I’ve been stuck in a situation, where I what to operate on 2 sets of data tree, but operate in different level. please see the image I attached.
For example I have first tree with branches {A}(i), second tree with branches {A;B}(i), A=A, so I want to match them both in {A} branch, so {0} with its corresponding subbranch {0;0}{0;1}{0;2}… only, don’t want {1} to match {0;0}{0;1}{0;2}… , Is there a way to do that?

Upload your file.