XPath is far too concise. It needs an XML encoding. Something like PMML, where math looks like
<DefineFunction name="frob" optype="continuous">
<ParameterField name="x" optype="continuous"/>
<Apply function="+">
<FieldRef field="x"/>
<Constant>42</Constant>
</Apply>
</DefineFunction>
I wish I were joking.