public static function saveToString($properties) {
        $xn = new \SimpleXMLElement(self::XML_ROOT_OPEN.self::XML_ROOT_CLOSE,LIBXML_NOXMLDECL);
            
        foreach ($properties as $key => $value) {
            $xn->addChild("entry", htmlspecialchars($value,ENT_XML1))->addAttribute("key",htmlspecialchars($key,ENT_XML1));
        }
        //LIBXML_NOXMLDECL is not supported, so replace the xml declaration to include also the dtd
        return preg_replace('/\<\?.*\?\>/', self::XML_PRELUDE, $xn->asXML());
        
    }