How to get the XML root element with its attributes, but without the content

Viewed 95

XML:

  <Parent id='1' name='Parent_1'>
    <Children name='Children'>
      <child name='Child_2' id='2'>child2_Parent_1</child>
      <child name='Child_4' id='4'>child4_Parent_1</child>
      <child name='Child_1' id='3'>child1_Parent_1</child>
      <child name='Child_3' id='1'>child3_Parent_1</child>
    </Children>
  </Parent>

Expected Output:

 <Parent id='1' name='Parent_1'>

Hi I have given some sample XML. I have tried with X Query for getting result but I cant identify . Can you please help someone.

Thanks!

1 Answers
Related