The problem seems straightforward, but I\'m having trouble getting access to the tag name of a SimpleXMLElement.
Let\'s say I have the follow XML structure:
Maybe easier way would be to replace the tags using preg functions for the XML source string?
Cleaner way
Create XSLT XML transformation file and use xsl PHP extension to translate it.
For this see this answer – Rename nodes with XSLT. PHP code part could be found in PHP documentation.