I have a xml file, and i need to append a child to it if a parent exists. So i used xpath to query for that specific node.
$dom = new DomDocument();
$dom->load('testing.xml');
$xp = new domxpath($dom);
$category = $xp->query("tree[@heading='something']");
Now i am not sure how to append a child to this result. The variable $category is a object when i do print_r($category).
Thanks