title: How to display value with field names from Solr XML files, getting values only
body: <p>I want to display the xml content differentiating the docs by fields names and values any help please..
  Below is my xml file content..</p>
  
  <pre><code>&lt;doc&gt;
      &lt;field name="id"&gt;1&lt;/field&gt;
      &lt;field name="name"&gt;A&lt;/field&gt;
      &lt;field name="sk"&gt;Acce&lt;/field&gt;
      &lt;field name="level"&gt;Beginner&lt;/field&gt;
      &lt;field name="do"&gt;Tuto&lt;/field&gt;
      &lt;field name="open"&gt;1&lt;/field&gt;
      &lt;field name="type"&gt;Ct&lt;/field&gt;
      &lt;field name="extensis"&gt;cl_ex&lt;/field&gt;
      &lt;field name="features"&gt;Atos&lt;/field&gt;
      &lt;field name="downl"&gt;&lt;/field&gt;
      &lt;field name="source"&gt;AtomicCounters&lt;/field&gt;
      &lt;field name="description"&gt;Ths.&lt;/field&gt;
      &lt;field name="tag1"&gt;&lt;/field&gt;
      &lt;field name="tag2"&gt;&lt;/field&gt;
      &lt;field name="tag3"&gt;&lt;/field&gt;
      &lt;field name="tag4"&gt;Global&lt;/field&gt;
      &lt;field name="tag5"&gt;Atomic&lt;/field&gt;
      &lt;field name="tag6"&gt;&lt;/field&gt;
      &lt;field name="tag7"&gt;&lt;/field&gt;
      &lt;field name="tag8"&gt;&lt;/field&gt;
      &lt;field name="tag9"&gt;&lt;/field&gt;
      &lt;field name="tag10"&gt;&lt;/field&gt;
    &lt;/doc&gt;
  
    &lt;doc&gt;
      &lt;field name="id"&gt;2&lt;/field&gt;
      &lt;field name="name"&gt;Ar&lt;/field&gt;
      &lt;field name="sk"&gt;Acrce&lt;/field&gt;
      &lt;field name="level"&gt;Beginner&lt;/field&gt;
      &lt;field name="do"&gt;Tuto1&lt;/field&gt;
      &lt;field name="open"&gt;11&lt;/field&gt;
      &lt;field name="type"&gt;C1t&lt;/field&gt;
      &lt;field name="extensis"&gt;cl_exd&lt;/field&gt;
      &lt;field name="features"&gt;Atos&lt;/field&gt;
      &lt;field name="downl"&gt;&lt;/field&gt;
      &lt;field name="source"&gt;ddddd&lt;/field&gt;
      &lt;field name="description"&gt;Thsdd.&lt;/field&gt;
      &lt;field name="tag1"&gt;&lt;/field&gt;
      &lt;field name="tag2"&gt;&lt;/field&gt;
      &lt;field name="tag3"&gt;&lt;/field&gt;
      &lt;field name="tag4"&gt;Global1&lt;/field&gt;
      &lt;field name="tag5"&gt;Atomic1&lt;/field&gt;
      &lt;field name="tag6"&gt;&lt;/field&gt;
      &lt;field name="tag7"&gt;&lt;/field&gt;
      &lt;field name="tag8"&gt;&lt;/field&gt;
      &lt;field name="tag9"&gt;&lt;/field&gt;
      &lt;field name="tag10"&gt;&lt;/field&gt;
    &lt;/doc&gt;
  </code></pre>
  
  <p>Below is the code I am using..</p>
  
  <pre><code> &lt;?php
      $result="";
      $document = new DOMDocument();
      //$document-&gt;load('/wamp/www/amd/261013/test/amd_one.xml');
      $document-&gt;load('http://localhost/solr/select');
  
  
  
      // this will also output doctype and comments at top level
      foreach($document-&gt;childNodes as $node)
         $result[] .= $document-&gt;saveXML($node)."\n";
  
      //echo $result[];
  
      foreach($result as $key =&gt; $value)
      {
        echo "$key - $value&lt;br/&gt;";
      }
  
      ?&gt;
  </code></pre>
  
  <p>However it is values only... like 1 Ar Acce....</p>
  
  <p>I want like $field = id, $value = 1,$field = name, $value = A, $field = id, $value = 2,$field = name, $value = Ar,..</p>
  
  <p>Any sugesstions please..</p>