Next we need to define a variable for the SVG image.
In this case the image variable is defined like below:
The XPath expression is included below as text:
concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800" width="800" height="800">
<text x="400" y="400" text-anchor="middle" dominant-baseline="middle" font-size="110"
font-family="sans-serif" fill="#000" fill-opacity="0.12" stroke="#000"
stroke-opacity="0.12" stroke-width="0" transform="rotate(45 400 200)">',
$textForWatermark,'</text></svg>')The image variable is here defined as svgImage and as you can see above the image variable refers to the variable, $textForWatermark, which contains the text, that we want to rotate and make into the watermark.
Just before the reference to the $textForWatermark variable you can see this: rotate(45 400 200). This specifies, that the text should be rotated 45 degrees. If you prefer another rotation, then you can simply change the number 45.