libraries/tbs/plugins/tbs_plugin_opentbs.php
function MsWord_CleanSpacePreserve(&$Txt) {
		$XmlLoc = clsTbsXmlLoc::FindStartTag($Txt, 'w:document', 0);
		if ($XmlLoc===false) return;
		if ($XmlLoc->GetAttLazy('xml:space') === 'preserve') return;
		
		$Txt = str_replace(' xml:space="preserve"', '', $Txt); // not mendatory but cleanner and save space
		$XmlLoc->ReplaceAtt('xml:space', 'preserve', true);

	}
function MsWord_CleanSpacePreserve(&$Txt) {
		$XmlLoc = clsTbsXmlLoc::FindStartTag($Txt, 'w:document', 0);
		if ($XmlLoc===false) return;
		if ($XmlLoc->GetAttLazy('xml:space') === 'preserve') return;
		
		$Txt = str_replace(' xml:space="preserve"', '', $Txt); // not mendatory but cleanner and save space
		$XmlLoc->ReplaceAtt('xml:space', 'preserve', true);

	}
Prevent from the problem of missing spaces when calling ->MsWord_CleanRsID() or under certain merging circumstances.
Replace attribute xml:space="preserve" used in <w:t>, with the same attribute in <w:document>.
This trick works for MsWord 2007, 2010 but is undocumented. It may be desabled by default in a next version.
LibreOffice does ignore this attribute in both <w:t> and <w:document>.