I am searching for a solution to transform this XML :
<A>
<B>
<X id="aaa" text="xyz" unit="mm">asdf</X>
<X id="bbb" text="xyz" unit="mm">asdf</X>
<X id="ccc" text="xyz" unit="mm">asdf</X>
...
</B>
<C>
<Y id="aaa" text="xyz" unit="mm">asdf</Y>
<Y id="bbb" text="xyz" unit="mm">asdf</Y>
<Y id="ccc" text="xyz" unit="mm">asdf</Y>
...
</C>
<D>
<Z id="aaa" text="xyz" unit="mm">asdf</Z>
<Z id="bbb" text="xyz" unit="mm">asdf</Z>
<Z id="ccc" text="xyz" unit="mm">asdf</Z>
...
</D>
...
</A>
into this:
<A>
<B_X_aaa id="aaa" text="xyz" unit="mm">asdf</B_X_aaa>
<B_X_bbb id="bbb" text="xyz" unit="mm">asdf</B_X_bbb>
<B_X_ccc id="ccc" text="xyz" unit="mm">asdf</B_X_ccc>
<C_Y_aaa id="aaa" text="xyz" unit="mm">asdf</C_Y_aaa>
<C_Y_bbb id="bbb" text="xyz" unit="mm">asdf</C_Y_bbb>
<C_Y_ccc id="ccc" text="xyz" unit="mm">asdf</C_Y_ccc>
<D_Z_aaa id="aaa" text="xyz" unit="mm">asdf</D_Z_aaa>
<D_Z_bbb id="bbb" text="xyz" unit="mm">asdf</D_Z_bbb>
<D_Z_ccc id="ccc" text="xyz" unit="mm">asdf</D_Z_ccc>
</A>
So the last part of the transformed xml node name has to be the 'id' attribute value and the attributes have to be copied all
Thank you