title: SimpleXML get element content based on attribute value
body: <p>I'm trying to access the content of an element based on the value of an attribute. With PHP SimpleXML. I've got the following XML setup:</p>
  
  <pre><code>&lt;DocSum&gt; 
      &lt;Id&gt;21242919&lt;/Id&gt; 
      &lt;Item Name="Author" Type="String"&gt;Nguyen T&lt;/Item&gt;
      &lt;Item Name="Title" Type="String"&gt;[Hemoptysis and spontaneous rupture of a primary renal angiosarcoma: a case report.]&lt;/Item&gt;
  &lt;/DocSum&gt;
  &lt;DocSum&gt; 
      &lt;Id&gt;21242919&lt;/Id&gt; 
      &lt;Item Name="Author" Type="String"&gt;Oliveira GC&lt;/Item&gt;
      &lt;Item Name="Title" Type="String"&gt;Disclosing ambiguous gene aliases by automatic literature profiling.&lt;/Item&gt;
  &lt;/DocSum&gt;
  &lt;DocSum&gt; 
      &lt;Id&gt;21242919&lt;/Id&gt; 
      &lt;Item Name="Author" Type="String"&gt;Vanderwall DE&lt;/Item&gt;
      &lt;Item Name="Title" Type="String"&gt;Metformin and digestive disorders.&lt;/Item&gt;
  &lt;/DocSum&gt;
  </code></pre>
  
  <p>These are books. In this case I'm trying to get the title. What I have so far is this:</p>
  
  <pre><code>$xml = simplexml_load_file(url);
  $docs = $xml-&gt;DocSum;
  foreach($docs as $book){
          // Each book individual
  }
  </code></pre>
  
  <p>Where the comment is I tried a lot of things.</p>