How to loop through all the species and write additional reactions based on that

What I want to do is to build a few models based on ReactionSystem in Catalyst.jl, named as m1, m2… Each of them has some common species s1, s2… I want to have a function with m1, m2 as arguments, which will automatically loop through the common species and build new reactions like m1.s1<->m2.s1…
I haven’t figured out a way to do it. Thanks in advance for any comments and suggestions

Sorry for missing this comment – I’ve been sick and then traveling and haven’t kept up on issues the past several weeks. If you haven’t figured anything out, perhaps this is what you were looking for?

using Catalyst
using ModelingToolkit: getname

rn1 = @reaction_network rn1 begin
       k1, X1 --> X2
       end

rn2 = @reaction_network rn2 begin
       k2, X2 --> X1
       end

rxs = []
i = 1
for s in species(rn1)
    if any(isequal(s), species(rn2))
        ratesym = Symbol("exchangerate$(i)")
        rate = (@parameters $(ratesym))[1]
        sname1 = getproperty(rn1, getname(s))
        sname2 = getproperty(rn2, getname(s))
        push!(rxs, Reaction(rate, [sname1], [sname2]))
        i += 1
     end
end
@variables t
@named rn = ReactionSystem(rxs, t; systems = [rn1, rn2])

giving

julia> reactions(rn)
4-element Vector{Reaction}:
 exchangerate1, rn1₊X1 --> rn2₊X1
 exchangerate2, rn1₊X2 --> rn2₊X2
 rn1₊k1, rn1₊X1 --> rn1₊X2
 rn2₊k2, rn2₊X2 --> rn2₊X1