Update default.php to gracefully handle templates with no xml data 

The Hathor template manager fails to display the 'Templates' tab if the site contains a template without xml data (in my case ja_purity).  The problem occurs because this file tries to access $this->xmldata->get('version') without checking whether it is null.  My proposed fix tests for the case of null xmldata and creates a new object with the required fields.  In the case where the xmldata exists, the change creates a cloned object and ensures that the required fields aren't null.

Further down in the code, we access $xmldata, the new object, rather than $item->xmldata.