title: xpath query checked radio button parent label text inside
body: <p>i need to grab the text inside a label with a specific 
  class that has a checked radio input inside it.</p>
  
  <p><strong>This is the HTML:</strong></p>
  
  <pre><code>&lt;div id="ships-from2"&gt;
  
      &lt;label for="ship_hk_intl"&gt;
          &lt;input type="radio" name="ship_mode_name" id="ship_hk_intl" data-action="http://www.example.com/" value="hk_intl"&gt;
              Hong Kong Warehouse - USD44.31
      &lt;/label&gt;
  
      &lt;label for="ship_us_intl"&gt;
          &lt;input type="radio" name="ship_mode_name" id="ship_us_intl" data-action="http://www.example.com/" checked value="us_intl"&gt;
              United States Warehouse - USD45.10
      &lt;/label&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>.<br>
  <strong>I need:</strong><br>
  the string inside the label that has a checked radio button.
  The actuall radio button might change so i need to check which one is checked</p>
  
  <p>I am scraping the dom and using xpath but have no idea how to write the query
  Ideas anyone?</p>
  
  <p>EDIT 1 - CODE THUS FAR (response to @TimDev):</p>
  
  <pre><code>    $div        = $dom-&gt;getElementById('ships-from2');
      $query      = '//input[@checked]/../text()';
      $e          = $xpath-&gt;query($query, $div);
      echo 'TEST:'.trim($e-&gt;item(1)-&gt;nodeValue);
  </code></pre>