I have an xml similar to the following which has some element composed by an url. That url is another webservice which contains another xml. What I need to do is completing my xml with information from the webservice, and I would like to achieve that with camel. Here goes the example:
Initial xml
<root>
<level11>Level1.txt</level1>
<level12>
<level21>http://someservice/11</level21>
<level21>http://someservice/12</level21>
</level12>
<level13>
<level22>http://someservice/21</level22>
<level22>http://someservice/22</level22>
</level13>
</root>
http://someservice
is returning an xml which i have to replace into original xml. For example
http://someservice/11
returns
<someservice>
<test>11</test>
</someservice>
http://someservice/12
returns
<someservice>
<test>12</test>
</someservice>
http://someservice/21
returns
<someservice>
<test>21</test>
</someservice>
http://someservice/22
returns
<someservice>
<test>22</test>
</someservice>
my final xml would be:
<root>
<level11>Level1.txt</level1>
<level12>
<level21>
<someservice>
<test>11</test>
</someservice>
</level21>
<level21>
<someservice>
<test>12</test>
</someservice>
</level21>
</level12>
<level13>
<level22>
<someservice>
<test>21</test>
</someservice>
</level22>
<level22>
<someservice>
<test>22</test>
</someservice>
</level22>
</level13>
</root>
So my question is what is the best pattern I should use to achieve this result?