Magic Parser vs. SimpleXML

Recently a client hired me to create a PHP script to populate a MySQL database based on data in a series of XML files. A simple enough task, but the client had recently spent $80 on a product called Magic Parser and so wanted me to use the tool in my code. While I am sure the expenditure would have been worth it had the task been different, I was not at all impressed with Magic Parser’s performance with this particular task.

When I’m parsing through XML code I really want a tree-like structure. Magic Parser returns everything in a flat array, with tag names separated by slashes. For example:

<foo>
 <bar>A</bar>
</foo>