title: Apache Camel processing with a substring of the message
body: <p>I want to build a Camel route that do 3 HttpRequests but in every request it should only a part of the body.</p>
  
  <p>In my Message Body is this XML:</p>
  
  <pre><code>&lt;part1&gt;
  ...
  &lt;/part1&gt;
  &lt;part2&gt;
  ...
  &lt;/part2&gt;
  &lt;part3&gt;
  ...
  &lt;/part3&gt;
  </code></pre>
  
  <p>Now every Part should send to a REST-Service. The Rest-Service response with some data, this data I must put in the body of the next part. How can I solve this?</p>
  
  <p>The route should like this:</p>
  
  <pre><code>from("activemq:inMsg")
   .setBody(xpath("//part1")).inOut("http4://localhost/workingPart1")
   .choice()
     .when()
       .replay().isEqual("ok")
       .setBody("&lt;responsePart1&gt;"+replay()+"&lt;/responsePart1&gt;" + xpath("//part2")).inOut("http4://localhost/workingPart2")
       .choice()
          .when()
            .replay().isEqual("ok")
            .setBody("&lt;responsePart2&gt;"+replay()+"&lt;/responsePart2&gt;" + xpath("//part3")).inOut("http4://localhost/workingPart3")
          .otherwiese().to("activemq:error")
       .end()
    .otherwiese().to("activemq:error")
    .end()
  </code></pre>
  
  <p>Can you help me to find the right syntax?</p>
  
  <p>Thank you</p>