We can get rid of the extra XHTML pre element by noticing that it always contains an XHTML b element child.
This step can remove that element:
<p:subtree select="h:pre"> <p:route> <p:when test="h:pre/h:b"> <p:delete/> </p:when> </p:route> </p:subtree>
This deletes a 'pre' element when it contains a 'b' element.