I'm trying to figure out how I delete multiple xml "records" if there is no attributes?Here is what I have tried untill now:\[code\]$xml = new DOMDocument();$xml->preserveWhiteSpace = false;$xml->formatOutput = true;$xml->loadXML('<friends> <friend id="779"> <name>ML76</name> <games/> <wins/> </friend> <friend id="131"> <name>Puttepigen67</name> <games/> <wins/> </friend> <friend id="17"> <name>rikkelolk</name> <games>3</games> <wins>2</wins> </friend> <friend id=""> <name/> <games/> <wins/> </friend> <friend id=""> <name/> <games/> <wins/> </friend> <friend id=""> <name/> <games/> <wins/> </friend></friends>');echo "<xmp>OLD \n". $xml->saveXML() ."</xmp>";$opNodes = $xml->getElementsByTagName('friend');$remove = array();foreach ($opNodes as $node) { if ($node->attributes() == ""){ $remove[] = $node; }}foreach ($remove as $node) { $node->parentNode->removeChild($node);}echo "<xmp>NEW \n". $xml->saveXML() ."</xmp>";\[/code\]I don't get anything in the last XML->saveXML().What am I doing wrong?Thanks in advance