I have XML similar in structure to the below example stored in a Camel header as a String:
<list>
<library>
<name>xxx</name>
<address>
<line1>aaa</line1>
<line2>bbb</line2>
<line3>ccc</line3>
</address>
</library>
<book>
<author>
<name>John</name>
<number>4324234</number>
</author>
<title>New Book</title>
<isbn>dsdaassda</isbn>
</book>
<book>...</book>
<book>...</book>
</list>
I would like to extract the library element into another Camel header
<library>
<name>xxx</name>
<address>
<line1>aaa</line1>
<line2>bbb</line2>
<line3>ccc</line3>
</address>
</library>
How can I achieve this using Camel Java DSL?
(My main source of confusion is applying the XPath to an exchange header item rather than the body)