Hallo,
try this:
<?php
error_reporting(E_ALL | E_STRICT);
header('Content-Type: text/plain');
$xmlstr = '<colors>
<color>
<name>Orange</name>
<ton1>Rot</ton1>
<ton2>Gelb</ton2>
</color>
<color>
<name>Braun</name>
<ton1>Rot</ton1>
<ton2>Gruen</ton2>
</color>
</colors>';
$xml = new SimpleXMLElement($xmlstr);
foreach($xml->xpath('color') as $color){
if ($color->ton1 == 'Rot') {
unset($color[0]);
}
}
echo($xml->asXML());
?>
Mathias