Given 2 XML documents:
Document 1:
<A>
...
<B>..<B>
<include>reference/to/document2</include>
<C>..</C>
...
</A>
Document 2:
<X>
<Y>..<Y>
<Z>..</Z>
</X>
I need to replace <include>
node in document 1 with the content of document 2. The final document should be:
<A>
...
<B>..<B>
<X>
<Y>..<Y>
<Z>..</Z>
</X>
<C>..</C>
...
</A>
Is it possible to do it with rapidxml? It should be straight forward to add it to the bottom. But I could not figure out yet how to replace a node (or insert after the specific node N and then remove node N).