XmlPoke task trims value
See the question and my original answer on StackOverflowValue is an MSBuild "Item" Usually, items represent file paths and MSBuild treats these in a special (undercover) way.
So, the issue is not related to XML escaping but to MSBuild item escaping. This is how you can force the space character:
<XmlPoke ... Value="X%20" ... />