title: Access an element's parent with PHP's SimpleXML?
body: <p>I'm iterating through a set of SimpleXML objects, and I can't figure out how to access each object's parent node.  Here's what I want:</p>
  
  <pre><code>$divs = simplexml-&gt;xpath("//div");
  foreach ($divs as $div)
  {
     $parent_div = $div-&gt;get_parent_node(); // Sadly, there's no such function.
  }
  </code></pre>
  
  <p>Seems like there must be a fairly easy way to do this.</p>