if (test-expression) then expression else expression
if ($part/@discounted) then $part/wholesale else $part/retail
(As expression languages go, XPath 2.0 is stretching to become a programming language)