xpath($xpath); $extensions = $node[0]['value']; if ($extensions) { $xmlPhpStorm = simplexml_load_file($xmlFilePhpStorm); $xpath = '//project/component[@name="PHPCodeSnifferOptionsConfiguration"]/option[@name="extensions"]'; $node = $xmlPhpStorm->xpath($xpath); if (isset($node[0]['value'])) { $node[0]['value'] = $extensions; $xmlPhpStorm->asXML($xmlFilePhpStorm); } } }