If you are using Sandcastle, the documentations suggests to embed your Xml code example into a <![CDATA[]]>
like this:
''' <summary>
''' ...
''' </summary>
''' <example>
''' <code language="xml" title="Xml Code sample">
''' <![CDATA[
''' <?xml version="1.0" encoding="utf-8"?>
''' <element>
''' <child>value</child>
''' </element>
''' ]]>
''' </code>
''' </example>
I did not have the chance to test this yet.