diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index 1a0bec2f3542b90e7b84580780aa6812f339a8fe..6bf5e63f000698547f385d3c2b69c1706631818c 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -1346,8 +1346,8 @@ function evaluer_fond ($fond, $contexte=array(), $options=array(), $connect=null
 		ob_end_clean();
 	}
 
-	if (!isset($options['protect_xml'])
-	AND isset($page['entetes']['X-Xml-Hack']))
+	if (isset($page['entetes']['X-Xml-Hack'])
+	AND isset($options['protect_xml']) AND $options['protect_xml'])
 		$page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']);
 
 	$GLOBALS['_INC_PUBLIC']--;
diff --git a/ecrire/public.php b/ecrire/public.php
index 14d2112158f33b27abeb05788d92756758b025c1..426a6d2eb55fc3b6b7a4f777b3ddc0c85ddb27ba 100644
--- a/ecrire/public.php
+++ b/ecrire/public.php
@@ -213,9 +213,9 @@ if ($GLOBALS['_INC_PUBLIC']>0) {
 			}
 		}
 	}
-	
+
 	if ($html) $page = analyse_js_ajoutee($page);
-  
+
 	// Passer la main au debuggueur le cas echeant
 
 	if ($var_mode == 'debug') {
@@ -235,7 +235,7 @@ if ($GLOBALS['_INC_PUBLIC']>0) {
 	//
 
 	// Report du hack pour <?xml (cf. public/compiler.php)
-	if (strpos($page['texte'],"<\1?xml")!==FALSE)
+	if ($xml_hack)
 		$page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']);
 
 	// (c'est ici qu'on fait var_recherche, tidy, boutons d'admin,
diff --git a/ecrire/public/assembler.php b/ecrire/public/assembler.php
index 623d11c5a0287934dce063ff33b83129e5a74398..9f46faf141ae1ee858d2ae3e993a889b032d525d 100644
--- a/ecrire/public/assembler.php
+++ b/ecrire/public/assembler.php
@@ -550,7 +550,7 @@ function message_erreur_404 ($erreur= "") {
 // fonction permettant de recuperer le resultat du calcul d'un squelette
 // pour une inclusion dans un flux
 // http://doc.spip.org/@recuperer_fond
-function recuperer_fond($fond, $contexte=array(), $protect_xml=false, $trim=true, $connect='') {
+function recuperer_fond($fond, $contexte=array(), $protect_xml=true, $trim=true, $connect='') {
 	$options = array(
 		'protect_xml' => $protect_xml,
 		'trim' => $trim