# XML Get Child Element

Gets the specified child element from a specified XML structure.

Action available for the following operating systems:

![](https://3821468174-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrTlA1suFa5N48x_83N%2F-MAlPVpH3WRwBy16c7JY%2F-MAlQBZuuTnc6hyzKSVQ%2Fimage.png?alt=media\&token=5c9534b7-ca05-4ac4-b408-2207cd5a5295)

### Parameters

* **XML** <*string*> - The control, variable or a string that represents a XML file.
* **Child's Name** <*string*> - The name of the child element that user wants to get.
* **Child's Index** <*numeric*> - The index of the child element to get.
* **Ignore Name's Prefix** - This parameter defines if the user wants to ignore the name's prefix or not. It can be one of:
  * 1\. Yes
  * 2\. No
* **Include GrandChildren** - Defines if user wants to get the grand-children elements of the selected element to get. It can be one of:
  * 1\. Yes
  * 2\. No
* **Return Type** - The type of the returned element. It can be one of:
  * 1\. Full Element
  * 2\. Element Content
* **Target** - The control or variable to save the child element of an XML.

### Usage

Consider the following XML file, saved in variable VAR(XMLResponse):

```
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <m:AllForwardsResponse xmlns:m="http://footballpool.dataaccess.eu">
      <m:AllForwardsResult>
        <m:string>Aleksandr Kerzhakov</m:string>
        <m:string>Alex Oxlade-Chamberlain</m:string>
        <m:string>Álvaro Negredo</m:string>
        <m:string>André Schürrle</m:string>
        <m:string>Andrei Arshavin</m:string>
        <m:string>Andriy Shevchenko</m:string>
        <m:string>Andriy Voronin</m:string>
        <m:string>Andriy Yarmolenko</m:string>
        <m:string>Andy Carroll</m:string>
        <m:string>Antonio Cassano</m:string>
      </m:AllForwardsResult>
    </m:AllForwardsResponse>
  </soap:Body>
</soap:Envelope>
```

#### Example 1

|                           |                     |
| ------------------------- | ------------------- |
| XML                       | VAR(XMLResponse)    |
| **Child's Name**          | "AllForwardsResult" |
| **Child's Index**         | 1                   |
| **Ignore Name's Prefix**  | YES                 |
| **Include Grandchildren** | YES                 |
| **Return Type**           | Full Element        |
| **Target**                | VAR(Result)         |

**Result:**

VAR(Result)

```
<m:AllForwardsResult>
<m:string>Aleksandr Kerzhakov</m:string>
<m:string>Alex Oxlade-Chamberlain</m:string>
<m:string>Álvaro Negredo</m:string>
<m:string>André Schürrle</m:string>
<m:string>Andrei Arshavin</m:string>
<m:string>Andriy Shevchenko</m:string>
<m:string>Andriy Voronin</m:string>
<m:string>Andriy Yarmolenko</m:string>
<m:string>Andy Carroll</m:string>
<m:string>Antonio Cassano</m:string>
</m:AllForwardsResult>
```

#### Example 2

|                           |                  |
| ------------------------- | ---------------- |
| **XML**                   | VAR(XMLResponse) |
| **Child's Name**          | "Body"           |
| **Child's Index**         | 1                |
| **Ignore Name's Prefix**  | YES              |
| **Include Grandchildren** | YES              |
| **Return Type**           | Full Element     |
| **Target**                | VAR(Result)      |

**Result:**

VAR(Result)

```
<soap:Body>
<m:AllForwardsResponse xmlns:m="http://footballpool.dataaccess.eu"> 
<m:AllForwardsResult>
<m:string>Aleksandr Kerzhakov</m:string>
<m:string>Alex Oxlade-Chamberlain</m:string>
<m:string>Álvaro Negredo</m:string>
<m:string>André Schürrle</m:string>
<m:string>Andrei Arshavin</m:string>
<m:string>Andriy Shevchenko</m:string>
<m:string>Andriy Voronin</m:string>
<m:string>Andriy Yarmolenko</m:string>
<m:string>Andy Carroll</m:string>
<m:string>Antonio Cassano</m:string>
</m:AllForwardsResult>
</m:AllForwardsResponse>
</soap:Body>
```
