In that case, initialize a new object, then use the getXMLBranch() member function of that object, e.g. $xmlObject2
it should work, but not really a cool for CPU.
ok, because i cant reproduce getting a reference with a class method (!) here is the code i use in the real context :
<?
require 'xml/xml.php';
$XMLMask = new XML (join ( '', file ('ordi/mask.xml')));
# mask.xml is :
#<mask-form>
# ...
# <mask name="resolution" type="select">
# <select>
# <option value="+">More than 1024*768</option>
# <option value="1024">1024*768</option>
# <option value="800">800*600</option>
# <option value="-">Less than 800*600</option>
# </select>
# </mask>
# ...
#</mask-form>
// from here are the 2 first pass of a loop, first for max sceen resolution, second for resolution in use
$mask = $XMLMask -> getBranches('mask-form', 'mask', 'name', 'resolution');
$mask = $mask[0]; // i expect only one issue
$mask -> setTagAttribute('name', 'maxRes', 'mask/select');
$option = $mask -> getBranches('mask/select', 'option', 'value', '-');
$option = $option[0];
$option -> setTagAttribute('selected', 'selected');
echo'<pre>' . htmlspecialchars($mask -> getXMLString(1)) . '<pre>';
# on screen there is :
# <mask name="resolution" type="select">
# <select>
# <option value="+">More than 1024*768</option>
# <option value="1024">1024*768</option>
# <option value="800">800*600</option>
# <option value="-" selected="selected">Less than de 800*600</option>
# </select>
# </mask>
$mask = $XMLMask -> getBranches('mask-form', 'mask', 'name', 'resolution');
$mask = $mask[0];
$mask -> setTagAttribute('name', 'resInUse', 'mask/select');
$option = $mask -> getBranches('mask/select', 'option', 'value', '+');
$option = $option[0];
$option -> setTagAttribute('selected', 'selected');
echo'<pre>' . htmlspecialchars($mask -> getXMLString(1)) . '<pre>';
# on screen there is :
# <mask name="resolution" type="select">
# <select>
# <option value="+" selected="selected">More than 1024*768</option>
# <option value="1024">1024*768</option>
# <option value="800">800*600</option>
# <option value="-" selected="selected">Less than 800*600</option>
# </select>
# </mask>
?>