--- - name: probability tag: mi match: "(text()='P'" replace: - intent: name: "probability" children: [x: "text()"] - name: given tag: mo match: "(text()='|' and count(preceding-sibling::*)=1 and count(following-sibling::*)=1 and parent::preceding-sibling::*[last()][text()='P']" replace: - intent: name: "given" children: [x: "text()"]