I want to add, replace some tags, CDATAS etc.want to edit and save the file back replacing the previous one.same compression level and type (it's a gzip archive) used in the file, to be maintained. I know how to read complete xml file. Here is how much I know. need to write and compress it back. The original compressed file name is "mycompressedgzipfile.gzip".
<?php
$xml = simplexml_load_file("compress.zlib://mycompressedgzipfile.xml",'SimpleXMLElement',LIBXML_NOCDATA);
echo '<pre>';
print_r($xml);
echo '</pre>';
?>