How to obtain child nodes only using Xpath in Logic Apps RRS feed

  • Question

  • Hi,

    I am trying to obtain the child nodes of <Task> in the following XML message:

    <soapenv:Envelope xmlns:soapenv='' xmlns:opt='' xmlns:cts=''>


    I am currently using the following Xpath syntax, stored as a string variable: 


    This returns the correct values, however, I would like the returned collection of nodes to exclude the <Task> tag from the top and bottom.  Is there a way to simply just return the child nodes without the parent node?


    Thursday, November 14, 2019 2:51 AM

All replies

  • The simplest way is to read each child node individually as shown below:


    Alternatively convert your XML to Json and read the Task Node as shown below:


    Thursday, November 14, 2019 1:53 PM
  • Hi,

    Thanks for the reply.  I've used your code to convert the XML to JSON which works just fine.  I now need to convert it back to XML once I've added the extra data. What is the best way to do this please?  

    Sunday, November 17, 2019 9:58 PM