protected function removeChildNodeIfNotNull($node, $child) { if (!is_null($node->{$child})) { unset($node->{$child}); } }