I included an xml file to another that described in this answer https://stackoverflow.com/a/5127928/702642
Then I read it by using simplexml with below code
$mydom = new SimpleXMLElement(file_get_contents("myxml.xml"), LIBXML_NOENT);
//Do some changes in xml
$mydom->asXML("myxml.xml");
The problem is asXML function save all content to myxml.xml file like it never has a another included xml file. How can I save included xml and main xml files separately?