<?php
$data = '
<products>
<product active="1" on_sale="0" discountable="0">
<sku>SKUTARGET</sku>
<name><![CDATA[sdfsdf (NET)]]></name>
<description><![CDATA[agag adgsgsdg asdgsdg]]></description>
<keywords></keywords>
<price>9.000000</price>
<stock_quantity>35</stock_quantity>
<reorder_quantity>0</reorder_quantity>
<height>0.000000</height>
<length>0.000000</length>
<diameter>0.000000</diameter>
<weight>0.000000</weight>
<color>Black</color>
<material>PVC</material>
<barcode>883045010070</barcode>
<release_date>2008-11-10</release_date>
<images>
<image>/sdssd/sdfsd.jpg</image>
<image>/AL10sdfsds07XO/sdfsd.jpg</image>
</images>
<categories>
<category code="166" video="0" parent="172">sd & Sexy sdf</category>
<category code="172" video="0" parent="">sd & dddsdsds</category>
<category code="641" video="0" parent="172">sdfsdf Costume sdfsdfsdf</category>
</categories>
<manufacturer code="AL" video="0">sdfsdf sdfs</manufacturer>
<type code="LI" video="0">sdfsd</type>
</product>
<product active="1" on_sale="0" discountable="0">
<sku>XXXXXXX</sku>
<name><![CDATA[LEATHER sdfsdf (NET)]]></name>
<description><![CDATA[asdgsdgsd sad sadg asdg asdg asdg asdg asdg asdg asdg asdg asdg asdg asdg]]></description>
<keywords></keywords>
<price>5.000000</price>
<stock_quantity>36</stock_quantity>
<reorder_quantity>0</reorder_quantity>
<height>0.000000</height>
<length>0.000000</length>
<diameter>0.000000</diameter>
<weight>0.000000</weight>
<color>Black</color>
<material>Leather</material>
<barcode>883045300164</barcode>
<release_date>2008-11-10</release_date>
<images>
<image>/AL10sds0XO/sdsdsd.jpg</image>
<image>/sdsds/AL1sd00XOB.jpg</image>
<image>/AL1sdsds00XO/sdsds.jpg</image>
</images>
<categories>
<category code="80" video="0" parent="44">sdgsdgsdg</category>
<category code="181" video="0" parent="172">Sleep & Lounge</category>
</categories>
<manufacturer code="AL" video="0">Allure sdsds</manufacturer>
<type code="LI" video="0">sdsfsdfsd</type>
</product>
</products>';
$doc = new DOMDocument('1.0', 'UTF-8');
$doc->loadXML($data);
$frag = $doc->createDocumentFragment();
$frag->appendXML('<foo><bar>foobar</bar></foo>');
$xpath = new DOMXPath($doc);
$skus = $xpath->query('//products/product[sku="SKUTARGET"]');
foreach($skus as $sku)
{
$sku->parentNode->replaceChild($frag, $sku);
}
echo $doc->saveXML();