if (targetXPath != null) {
Object o = targetXPath.evaluate(synCtx);
if (o != null && o instanceof OMElement) {
OMNode tgtNode = (OMElement) o;
tgtNode.insertSiblingAfter(result);
tgtNode.detach();
} else if (o != null && o instanceof List && !((List) o).isEmpty()) {
// Always fetches *only* the first
OMNode tgtNode = (OMElement) ((List) o).get(0);
tgtNode.insertSiblingAfter(result);