Question: How to convert this in C# code?

```
//Cannot implicitly convert type 'System.Array' to 'decimal[]'.
//An explicit conversion exists
Array[] s = new Array[10];
for (int i = 0; i < 9; i++)
{
    s[i] = average; //average is decimal [] 
}
for (int i = 0; i < 2; i++)
{
    Mean = s[i]; //mean is decimal[] & s[i] system array 
}

```

Answer: 
If you want to use JQuery, you need to change the 

```
$example.each(function(){                   
        list.push($(this).children("word").children("definition").text());
                });

```

to

```
$example.children("word").children("definition").each(
  function() {                   
   list.push($(this).text());
  });

```
jquery solution 

```
    $example.find("word > definition").map(function(){ return $(this).text()}).toArray()

```

```js
var xml =
    '<example>' +
    '<phrase>phrase1</phrase>' +
    '<word>' +
    '<definition>definition1</definition>' +
    '</word>' +
    '<word>' +
    '<definition>definition2</definition>' +
    '</word>' +
    '</example>' +
    '';
var xmlDoc = new DOMParser().parseFromString(xml, 'text/xml');
var list = $("example > word > definition",xmlDoc).map(function(){ return $(this).text()}).toArray();
console.log(list);
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
```

vanila js solution

```js
// Code goes here
var list = [];
var txt = `<example>
    <phrase>phrase1</phrase>
    <word>
      <definition>definition1</definition>
    </word>
    <word>
      <definition>definition2</definition>
    </word>
</example>`;
if (window.DOMParser) {
  parser = new DOMParser();
  xmlDoc = parser.parseFromString(txt, "text/xml");
} else // Internet Explorer
{
  xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async = false;
  xmlDoc.loadXML(txt);
}

var elements = xmlDoc.getElementsByTagName("definition");

[].forEach.call(elements, function(el) {
  list.push(el.textContent)
});
console.log(list);
```