I am not so failiar with XML handling/managing, so I would like to ask your help in the following issue: I have an XML:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="somethiong_is_here...">
<node1>value1</node1>
<node2>
<node21>
<node211 enabled="true">
<node2111>valuvavalue</node2111>
</node211>
</node21>
</node2>
</root>
What I want, to change and/or replace the root node. It is fine for me, if I delete all attributes, namespace settings (all)...or create a new root node and add all children to the new node, where the result should be:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<node1>value1</node1>
<node2>
<node21>
<node211 enabled="true">
<node2111>valuvavalue</node2111>
</node211 >
</node21>
</node2>
</root>
As I mentioned, I am not so familiar with PHP - XML working. I tried it with SimpleXMLElement, DOMDocument, DOMElement, etc... But I wasn't able to delete root attributes or fully replace the root node.
I am using Php7.3
Thanks, Attila