I have created a PHP class for parsing XML using a tag library.
With this class, you can create custom tags like <popup> or <bigfatmenu size="verybig">
To define a tag, you can choose between two methods: Use a template definition with {placeholders} or create a php function that gets the content and parameters of a tag as arguments and returns the created HTML.
Check it out under http://chocobot.d2g.com/phptaglib.php
Sample XML: http://chocobot.d2g.com/phptaglib_0.1/sample.xml
After conversion: http://chocobot.d2g.com/phptaglib_0.1/sample.php
Bug reports go to chocobot@gmx.de