SimpleXML is PHP 5.x way to handle XML. It is simpler than DOMXML (which incidentally is very poorly documented in manual or elsewhere) which is available on PHP 4.x and much simpler than SAX solutions. However it doesn't work with certain installations of PHP 5.x. Let's see how we can solve it.

Problem
I first came across this when I realized my code works in home machine and not on site. PHP as usual silently gives up (solution to this in next post). In essence simplexml_load_string returns false without actually creating and returning the object. So you cannot use SimpleXML in any way.

Solution
After some debugging I found the solution. Here are the steps:

1. Open php.ini (How to find it?)
2. Search for zend.ze1_compatibility_mode
3. Change it to Off as shown below
zend.ze1_compatibility_mode = Off
4. Save php.ini and restart Apache

You are done!