我已经决定没有办法用SimpleXMLElements做到这一点。我一直在阅读PHPDOMDocument手册,我认为我可以通过迭代来完成,但这似乎效率低下。有没有我没有想到的更好的方法?类似伪代码的迭代解决方案://twoDOMDocumentswithsamerootelement$parent=new...$otherParent=new...$children=$parent->getElementByTagName('child');foreach($childrenas$child){$otherParent->appendChild($child);}为了清楚起见,我有两