Error converting VARCHAR(MAX) to XML due to "UTF-8" attribute
Your XML stored in a varchar(max) column should look like this.
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;PARAM&gt;
  &lt;TAB DIM=&quot;30&quot; ID=&quot;ZC3D2_1&quot; SIZE=&quot;5&quot;&gt;
    &lt;LIN NUM = &quot;1&quot;&gt;
      &lt;FLD NAME = &quot;ZDOC&quot; TYPE = &quot;Char&quot;&gt;Ferran LÃ³pez&lt;/FLD&gt;
    &lt;/LIN&gt;
  &lt;/TAB&gt;
&lt;/PARAM&gt;

The ó should be represented with a double byte value Ã³.
If you don't have a UTF-8 encoded string stored in your column, the right way to go about this is to remove the encoding from the XML before you convert the value to the XML datatype.