Надеюсь, этот пример поможет:
from("timer:foo?period=30s")
.setBody(constant("<oldWrapTag><someTag>123</someTag></oldWrapTag>"))
.convertBodyTo(org.w3c.dom.Document.class)
.setBody(xpath("//someTag"))
.setHeader("insert", simple("body"))
.to("xslt:/xslt/test.xsl")
.to("log:body?showBody=true")
;
xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="insert"/>
<xsl:template match="/">
<xsl:element name="wrapTag">
<xsl:copy-of select="$insert"/>
</xsl:element>
</xsl:template>
Вывод:
2018-10-24 14:03:07,952 | INFO | 10 - timer://foo | body | 247 - org.apache.camel.camel-core - 2.16.3 | Exchange[ExchangePattern: InOnly, BodyType: String, Body: <?xml version="1.0" encoding="UTF-8"?><wrapTag><someTag>123</someTag></wrapTag>]