Possible Duplicate:
How do you rename a tag in SimpleXML through a DOM object?
If I have an XML document like this:
<document>
<dogs>
<bulldog>Blu</bulldog>
<terrier>Benjie</terrier>
</dogs>
<cats>
<tiger>Tiggger</tiger>
<lion>Cowardly</lion>
</cats>
</document>
And I want to reprint it, adding some attributes, but not keep the original....
<document>
<canine type="fiction">
<bulldog>Blu</bulldog>
<terrier>Benjie</terrier>
</canine>
<feline type="fiction">
<tiger>Tiggger</tiger>
<lion>Cowardly</lion>
</feline>
</document>
What strategy would I use, to do so in SimpleXML?