title: Return Unique Values from an XML Files using PHP, simplexml_load_file and Xpath
body: <p>thank you for your assistance in advance. I have search through this forum and through the www looking for an answer to this but cannot find a straight forward one.</p>
  
  <p>I am simply trying to return results from an XML File that only extracts the unique value of an attribute.</p>
  
  <p><strong>XML Example File:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;computers&gt;
      &lt;restults&gt;
     &lt;computer id="1" group_id="a" model_group="acer" name="Acer 1 GB" /&gt;
     &lt;computer id="2" group_id="a" model_group="acer" name="Acer 2 GB" /&gt;
     &lt;computer id="3" group_id="b" model_group="acer" name="Acer 3 GB" /&gt;
     &lt;computer id="4" group_id="c" model_group="acer" name="Acer 4 GB"/&gt;
     &lt;computer id="5" group_id="c" model_group="acer" name="Acer 6 GB" /&gt;
     &lt;computer id="6" group_id="d" model_group="acer" name="Acer 8 GB" /&gt;
     &lt;computer id="7" group_id="d" model_group="acer" name="Acer 16 GB" /&gt;
     &lt;computer id="8" group_id="d" model_group="acer" name="Acer 32 GB" /&gt;
     &lt;computer id="9" group_id="e" model_group="acer" name="Acer 48 GB" /&gt;
      &lt;/restults&gt;
  &lt;/computers&gt;
  </code></pre>
  
  <p>What I want is for the php script to run through the XML file and only present me with the unique <code>"group_id" values. ie: a,b,c,d,e</code></p>
  
  <p>Nothing more.</p>
  
  <p>I've looked at various solutions, provided on this website and others, but they just haven't worked.</p>
  
  <p>I did read up about Xpath functions and the distinct-values function but I cannot find a way to identify what version of Xpath I am running? I do know that this function is only available in Xpath 2.0</p>