For future reference, I ended up making a PR that will let us copy xavps, I personally felt stuck without a clean and concise way to reorder xavp. The solution I am proposing will not copy the entire xavp stack and it will not support nested xavp this could probably be added later automatically from the core since I am using the xavp.c clone function. Will see what we find while reviewing. https://github.com/kamailio/kamailio/pull/2070