The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
<stx:transform version="1.0" 
  xmlns:stx="http://stx.sourceforge.net/2002/ns"
  strip-space="yes">

  <stx:template match="node[@id=2]">
    <stx:text>T1</stx:text>
    <stx:processing-instruction name="{name()}">
      <stx:text>PI-</stx:text>
      <stx:text>text</stx:text>
    </stx:processing-instruction>
    <stx:text>T2</stx:text>
  </stx:template>
  
</stx:transform>