This cheat-sheet contains various Xpath expressions used in Azure Logic Apps.
Sample XML
<Order>
<Product>
<Description>Espresso</Description>
<Price>1.50</Price>
<Size>S</Size>
</Product>
<Product>
<Description>Double Espresso</Description>
<Price>3.00</Price>
<Size>M</Size>
</Product>
<Product>
<Description>Latte Espresso</Description>
<Price>2.50</Price>
<Size>M</Size>
</Product>
<Product>
<Description>Water</Description>
<Price>0.50</Price>
<Size></Size>
</Product>
</Order>XPath to get the Price of the Latte Expresso product
xpath(variables('Order'), 'string(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Description" and text()="Latte Espresso"]]/*[local-name()="Price"])')
XPath to get a count of all the products
xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"])')
XPath to get a count of the products with Size M
xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Size" text()="M"])')
XPath to get a count of the products with Size not empty
xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Size"]/text())')