Magento Layout Error Recovery
Being a hugely complex system of files and functions, when Magento suddenly goes into error mode – that dreaded page that we are all aware of – it can sometimes be difficult to identify what’s gone wrong. One which I came across recently came completely out of the blue and was related to XML files in the layout folder.
The error appeared like this:

The error output read:
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 106: parser error : StartTag: invalid element name in /var/www/vhosts/mywebsite.co.uk/httpdocs/app/code/core/Mage/Core/Model/Layout/Update.php on line 294
The main reason why I wanted to post about this error is that there is absolutely no solution to it anywhere on the Internet, so it requires addressing. As I said, the error relates to modifications made in the /layouts folder as the function in Update.php: ‘public function fetchFileLayoutUpdates()’.
If this error appears you need to restore your layout XML files to their original states – then I would suggest re-inserting your edits one at a time, ensuring that no mistakes are made.

March 3rd, 2010
Hi Adam,
I have this same warning message. The last time it occurred we restored the site and every thing was up and running. This happened again now after 3 months when I tried to update the store name under admin/System/Manage Stores. I am not sure why this error is occurring often.
Can you please advise.
Thanks for your help.
March 4th, 2010
Hmm, I’m not entirely sure. Is it exactly the same error as the one I reported or is it slightly different. If it’s exactly the same you could benefit from restoring the XML files as I did.
Let me see the error if you can.
May 28th, 2010
I think your on to something with it being related to the store name. That was more or less the only change I made this morning, and I am running into a similar issue. Here is mine:
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 43: parser error : StartTag: invalid element name in /home/XXXXXX/XXXXXX/app/code/core/Mage/Core/Model/Layout/Update.php on line 431
Any thoughts?
June 1st, 2010
Hi Mike, have you tried downloading the latest version of Magento and restoring all your XML files. I’ve now had this error crop up twice and an XML restore has worked perfectly both times.
June 22nd, 2010
The same problem happened to my website today when I was creating custom module.
The problem is in the xml file in the /app/etc/modules/
The xml file started with:
instead of
**note that <? must have no space in between**
After that, I need to disable the module, before deleting it (direct deletion won't make the problem go away).
To disable it, write "false" instead "true" in the xml file of the new module:
false