diff --git a/ecrire/inc/xml.php b/ecrire/inc/xml.php
index d07a9a8b10bf4a99d400b3fab1e19f14fa66095a..b514bfb8c8c0f1cb58e94b6ba91626f9732e5374 100644
--- a/ecrire/inc/xml.php
+++ b/ecrire/inc/xml.php
@@ -95,7 +95,11 @@ function spip_xml_aplatit($arbre,$separateur = " "){
 			if (is_array($feuille)){
 				if ($tag!==intval($tag)){
 					$f = spip_xml_aplatit($feuille);
-					if (strlen($f))	$s.="<$tag>$f</$tag>";
+					if (strlen($f)) {
+						$tagf = explode(" ",$tag);
+						$tagf = $tag[0];
+						$s.="<$tag>$f</$tagf>";
+					}
 					else $s.="<$tag/>";
 				}
 				else