I assume that by now, you will have already solved this. But in any case, I would approach this with some kind of "/ Message Translator <http://bit.ly/MTEIP> /" solution in mind.
I'm very, very new to Camel. But I have a couple years experience using a big-name proprietary ESB. I've done similar transformations using that ESB's "/ Message Translator <http://bit.ly/MTEIP> /" support. The low-level details are different. But at a high-level... I would start off with some kind of reference to a single empty "/PricePlans/Body/" node (/call it $mtBody, for short/). Then for each <customer> I come across, I'd squirt each one in turn into my previously-prepared /$mtBody/ node. In pseudo-code... Or assuming each of my /<customer>/ elements have some unique identifier — maybe a "/custId/" attribute, say — it should be possible to forego a looping approach. Instead, I could envisage some kind of "/ Message Translator <http://bit.ly/MTEIP> /" that used XPath to somehow reference each /<customer>/ by its /custID/ attribute. How did you eventually solve it, by the way? -- View this message in context: http://camel.465427.n5.nabble.com/How-to-read-XML-Payload-tp5773337p5773427.html Sent from the Camel - Users mailing list archive at Nabble.com.