title: Extract #text part of XML using Powershell
body: <p>I'm trying to extract weather information out of a bureau of meteorology XML page using Powershell; from all the tutorials I've watched, and followed, not one of them explains how to extract the contents of the text part of an element, example:</p>
  <p>In the example code below, I'm after extracting the text &quot;Sunny&quot; and &quot;High&quot; from the &quot;forecast&quot; and &quot;fire_danger&quot; attributes. The path to get to &quot;forecast-period&quot; is: <code>product/forecast/area/forecast-period</code> the following code is out of the XML that I'm trying to extract content from:  <code>&lt;forecast-period index=&quot;1&quot; start-time-local=&quot;2022-07-17T00:00:00+08:00&quot;&gt;                 &lt;text type=&quot;forecast&quot;&gt;Sunny&lt;/text&gt; &lt;text type=&quot;fire_danger&quot;&gt;&lt;p&gt;High&lt;/p&gt;</code></p>
  <p>As you can see,  there's text &quot;Sunny&quot; and &quot;High&quot;, I'm trying to extrct them out individually.</p>
  <p>PS: I've also tried InnerText, InnerXML etc, but this seems to extraxt all other child elements, I'd like to [1] index to the first one or even the second one.</p>
  <p>Thank you,</p>