title: php simplexml_load_file can't get right value
body: <p>I want to get some value from <a href="http://www.ebi.ac.uk/ena/data/view/ERS032727&amp;display=xml" rel="nofollow">http://www.ebi.ac.uk/ena/data/view/ERS032727&amp;display=xml</a></p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;ROOT request="ERS032727&amp;amp;display=xml"&gt;
   &lt;SAMPLE alias="sample_Ae372-1" center_name="Beijing Genome Institute" accession="ERS032727"&gt;
   &lt;IDENTIFIERS&gt;
        &lt;PRIMARY_ID&gt;ERS032727&lt;/PRIMARY_ID&gt;
        &lt;EXTERNAL_ID namespace="BioSample"&gt;SAMEA762107&lt;/EXTERNAL_ID&gt;
        &lt;SUBMITTER_ID namespace="BGI"&gt;sample_Ae372-1&lt;/SUBMITTER_ID&gt;
   &lt;/IDENTIFIERS&gt;
   &lt;TITLE&gt;Acromyrmex echinatior&lt;/TITLE&gt;
   &lt;SAMPLE_NAME&gt;
        &lt;TAXON_ID&gt;103372&lt;/TAXON_ID&gt;
        &lt;SCIENTIFIC_NAME&gt;Acromyrmex echinatior&lt;/SCIENTIFIC_NAME&gt;
        &lt;COMMON_NAME&gt;Panamanian leafcutter ant&lt;/COMMON_NAME&gt;
   &lt;/SAMPLE_NAME&gt;
   &lt;DESCRIPTION&gt;Genome DNA sample for 500bp and 800bp insert size library&lt;/DESCRIPTION&gt;
   &lt;SAMPLE_LINKS&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-STUDY&lt;/DB&gt;
                  &lt;ID&gt;ERP000666&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-EXPERIMENT&lt;/DB&gt;
                  &lt;ID&gt;ERX012712-ERX012713&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-RUN&lt;/DB&gt;
                  &lt;ID&gt;ERR034186-ERR034187&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-SUBMISSION&lt;/DB&gt;
                  &lt;ID&gt;ERA030423&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-FASTQ-FILES&lt;/DB&gt;
                  &lt;ID&gt;http://www.ebi.ac.uk/ena/data/view/reports/sra/fastq_files/ERS032727&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
        &lt;SAMPLE_LINK&gt;
             &lt;XREF_LINK&gt;
                  &lt;DB&gt;ENA-SUBMITTED-FILES&lt;/DB&gt;
                  &lt;ID&gt;http://www.ebi.ac.uk/ena/data/view/reports/sra/submitted_files/ERS032727&lt;/ID&gt;
             &lt;/XREF_LINK&gt;
        &lt;/SAMPLE_LINK&gt;
   &lt;/SAMPLE_LINKS&gt;
   &lt;SAMPLE_ATTRIBUTES&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Time of sample collection&lt;/TAG&gt;
             &lt;VALUE&gt;2008&lt;/VALUE&gt;
             &lt;UNITS&gt;Year&lt;/UNITS&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Habitat&lt;/TAG&gt;
             &lt;VALUE&gt;Gamboa, Panama&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Sample extracted from&lt;/TAG&gt;
             &lt;VALUE&gt;1 male&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Sample type&lt;/TAG&gt;
             &lt;VALUE&gt;DNA&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;ENA-SPOT-COUNT&lt;/TAG&gt;
             &lt;VALUE&gt;119159746&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;ENA-BASE-COUNT&lt;/TAG&gt;
             &lt;VALUE&gt;23831949200&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
   &lt;/SAMPLE_ATTRIBUTES&gt;
  </code></pre>
  
  <p>
      </p>
  
  <p>I use $file= simplexml_load_file($path), but i just want to get this parts</p>
  
  <pre><code>&lt;SAMPLE_ATTRIBUTES&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Time of sample collection&lt;/TAG&gt;
             &lt;VALUE&gt;2008&lt;/VALUE&gt;
             &lt;UNITS&gt;Year&lt;/UNITS&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Habitat&lt;/TAG&gt;
             &lt;VALUE&gt;Gamboa, Panama&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Sample extracted from&lt;/TAG&gt;
             &lt;VALUE&gt;1 male&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;Sample type&lt;/TAG&gt;
             &lt;VALUE&gt;DNA&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;ENA-SPOT-COUNT&lt;/TAG&gt;
             &lt;VALUE&gt;119159746&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
        &lt;SAMPLE_ATTRIBUTE&gt;
             &lt;TAG&gt;ENA-BASE-COUNT&lt;/TAG&gt;
             &lt;VALUE&gt;23831949200&lt;/VALUE&gt;
        &lt;/SAMPLE_ATTRIBUTE&gt;
   &lt;/SAMPLE_ATTRIBUTES&gt;
  </code></pre>
  
  <p>i set $file->SAMPLE_ATTRIBUTES, but can't work.
  How can i get each sample attribute in the sample attributes
  like </p>
  
  <pre><code>Time of sample collection= 2008 Year
  Habitat= Gamboa, Panama
  Sample extracted from= 1 male
  ....
  .....
  </code></pre>