title: Unable to access object attribute values using Twig in Symfony 2.2
body: <p>I cannot access the objects properties using the Twig dot notation. For example, from looking at the object dump, I should be able to do image.copyright, which should print "Blue button near the Cayman Islands, Caribbean (© Lawson Wood/Aurora Photos)" for the first item.</p>
  
  <p>The error message I get is </p>
  
  <blockquote>
    <p>Method "copyright" for object "SimpleXMLElement" does not exist in ARRaiDesignBundle:Default:wallpapers.html.twig at line 12</p>
  </blockquote>
  
  <p>While dumping the object using dump(image) dumps each of the objects.</p>
  
  <p>Controller class:</p>
  
  <pre><code>$host = 'http://www.bing.com';
  $file = $host . '/HPImageArchive.aspx?format=xml&amp;idx=0&amp;n=10&amp;mkt=en-US';
  $xml = simplexml_load_file($file);
  
  return $this-&gt;render('ARRaiDesignBundle:Default:wallpapers.html.twig', array('xml' =&gt; $xml, 'host' =&gt; $host));
  </code></pre>
  
  <p>wallpapers.html.twig file:</p>
  
  <pre><code>...
  {% for image in xml %}
  &lt;p&gt;&lt;pre&gt;{{ image.copyright }}&lt;/pre&gt;&lt;/p&gt;
  {% endfor %}
  ...
  </code></pre>
  
  <p>Object dump using dump(image) in Twig:</p>
  
  <pre><code>object(SimpleXMLElement)#268 (12) {
    ["startdate"]=&gt;
    string(8) "20130330"
    ["fullstartdate"]=&gt;
    string(12) "201303300000"
    ["enddate"]=&gt;
    string(8) "20130331"
    ["url"]=&gt;
    string(46) "/az/hprichbg/rb/BlueButton_EN-US1108621411.jpg"
    ["urlBase"]=&gt;
    string(43) "/az/hprichbg/rb/BlueButton_EN-US10208337365"
    ["copyright"]=&gt;
    string(77) "Blue button near the Cayman Islands, Caribbean (© Lawson Wood/Aurora Photos)"
    ["copyrightlink"]=&gt;
    string(74) "http://www.bing.com/search?q=Blue+Button+%28Porpita+porpita%29&amp;form=hpcapt"
    ["drk"]=&gt;
    string(1) "1"
    ["top"]=&gt;
    string(1) "1"
    ["bot"]=&gt;
    string(1) "1"
  ...
  </code></pre>
  
  <p>Can anyone suggest how to do this? I know I can use PHP rendering instead of Twig, but that's not a fix for me. Thanks.</p>