title: Prestashop Web service to return JSON
body: <p>After extensive search over internet i am sure that Prestashop does not return data in JSON format, it only returns in XML format (which leads to cross domain accessing issue unfortunately).</p>
  
  <p>Now, I am trying to convert XML(returned by Prestashop) to JSON. I want to write php code which could take XML from web service and sent back JSON. For this purpose i tried many tutorial but in vain. The converted JSON does not have value in it, so is useless.
  The methods i tried are listed below.</p>
  
  <p><a href="http://www.sitepoint.com/php-xml-to-json-proxy/" rel="nofollow noreferrer">http://www.sitepoint.com/php-xml-to-json-proxy/</a><br>
  <a href="https://stackoverflow.com/questions/8830599/php-convert-xml-to-json">PHP convert XML to JSON</a></p>
  
  <p><strong>XML to convert:</strong></p>
  
  <pre><code>&lt;name&gt;
  &lt;language id="1" xlink:href="http://localhost/prestashop/api/languages/1"&gt;
  &lt;![CDATA[ iPod Nano ]]&gt;
  &lt;/language&gt;
  &lt;/name&gt;
  </code></pre>
  
  <p><strong>Returned JSON:</strong></p>
  
  <pre><code>"name":{"language":{"@attributes":{"id":"1"}}}
  </code></pre>