I've had some success due to the help of people on here to modify a complex XML source for use with jsTree. However now that I have data that is usable, it is only so if i manually edit the XML to do the following :[*]Rename all \[code\]<user>\[/code\] tags to [*]Remove some elements before the first \[code\]<user>\[/code\] tag[*]insert an \[code\]'encoding=UTF-8'\[/code\] into the XML opener[*]and lastly modify the \[code\]<response>\[/code\] (opening XML tag) to \[code\]<root>\[/code\]XML File Example : SampleXMLI have read and read through so many pages on here and google and cannot find a method to achieve the above items.Point (2) I have found out that by loading it via SimpleXML and using \[code\]UNSET\[/code\] i can delete the portions I do not require, however I am still having troubles with the rest.I thought I could perhaps modify the source with SimpleXML (that I am more familiar with) and then continue to modify the code via the help I had been provided before.\[code\]<?php$s = file_get_contents('http://www.fluffyduck.com.au/sampleXML.xml');$doc1 = simplexml_load_string($s);unset($doc1->row);unset($doc1->display);#$moo = $doc1->user;echo '<textarea>';echo $doc1->asXML();echo '</textarea>';$doc = new DOMDocument();$doc->loadXML($doc1);$users = $doc->getElementsByTagName("user");foreach ($users as $user){ if ($user->hasAttributes()) { // create content node $content = $user->appendChild($doc->createElement("content")); // transform attributes into content elements for ($i = 0; $i < $user->attributes->length; $i++) { $attr = $user->attributes->item($i); if (strtolower($attr->name) != "id") { if ($user->removeAttribute($attr->name)) { if($attr->name == "username") { $content->appendChild($doc->createElement('name', $attr->value)); } else { $content->appendChild($doc->createElement($attr->name, $attr->value)); } $i--; } } } }}$doc->saveXML();header("Content-Type: text/xml");echo $doc->saveXML();?>\[/code\]