diff --git a/magick/xml-tree.c b/magick/xml-tree.c
index d6fd097..3e02023 100644
--- a/magick/xml-tree.c
+++ b/magick/xml-tree.c
@@ -352,22 +352,22 @@
     {
       case '&':
       {
-        i+=FormatMagickString(canonical_content+i,extent,"&");
+        i+=FormatLocaleString(canonical_content+i,extent,"&");
         break;
       }
       case '<':
       {
-        i+=FormatMagickString(canonical_content+i,extent,"&lt;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&lt;");
         break;
       }
       case '>':
       {
-        i+=FormatMagickString(canonical_content+i,extent,"&gt;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&gt;");
         break;
       }
       case '"':
       {
-        i+=FormatMagickString(canonical_content+i,extent,"&quot;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&quot;");
         break;
       }
       case '\n':
@@ -377,7 +377,7 @@
             canonical_content[i++]=(char) (*p);
             break;
           }
-        i+=FormatMagickString(canonical_content+i,extent,"&#xA;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&#xA;");
         break;
       }
       case '\t':
@@ -387,12 +387,12 @@
             canonical_content[i++]=(char) (*p);
             break;
           }
-        i+=FormatMagickString(canonical_content+i,extent,"&#x9;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&#x9;");
         break;
       }
       case '\r':
       {
-        i+=FormatMagickString(canonical_content+i,extent,"&#xD;");
+        i+=FormatLocaleString(canonical_content+i,extent,"&#xD;");
         break;
       }
       default:
@@ -2361,7 +2361,7 @@
       if (*destination == (char *) NULL)
         return(*destination);
     }
-  *length+=FormatMagickString(*destination+(*length),*extent,"%s",
+  *length+=FormatLocaleString(*destination+(*length),*extent,"%s",
     canonical_content);
   canonical_content=DestroyString(canonical_content);
   return(*destination);
@@ -2398,7 +2398,7 @@
       if (*source == (char *) NULL)
         return(*source);
     }
-  *length+=FormatMagickString(*source+(*length),*extent,"<%s",xml_info->tag);
+  *length+=FormatLocaleString(*source+(*length),*extent,"<%s",xml_info->tag);
   for (i=0; xml_info->attributes[i]; i+=2)
   {
     attribute=GetXMLTreeAttribute(xml_info,xml_info->attributes[i]);
@@ -2411,11 +2411,11 @@
         if (*source == (char *) NULL)
           return((char *) NULL);
       }
-    *length+=FormatMagickString(*source+(*length),*extent," %s=\"",
+    *length+=FormatLocaleString(*source+(*length),*extent," %s=\"",
       xml_info->attributes[i]);
     (void) EncodePredefinedEntities(xml_info->attributes[i+1],-1,source,length,
       extent,MagickTrue);
-    *length+=FormatMagickString(*source+(*length),*extent,"\"");
+    *length+=FormatLocaleString(*source+(*length),*extent,"\"");
   }
   i=0;
   while ((attributes[i] != (char **) NULL) &&
@@ -2438,14 +2438,14 @@
         if (*source == (char *) NULL)
           return((char *) NULL);
       }
-    *length+=FormatMagickString(*source+(*length),*extent," %s=\"",
+    *length+=FormatLocaleString(*source+(*length),*extent," %s=\"",
       attributes[i][j]);
     (void) EncodePredefinedEntities(attributes[i][j+1],-1,source,length,extent,
       MagickTrue);
-    *length+=FormatMagickString(*source+(*length),*extent,"\"");
+    *length+=FormatLocaleString(*source+(*length),*extent,"\"");
     j+=3;
   }
-  *length+=FormatMagickString(*source+(*length),*extent,*xml_info->content ?
+  *length+=FormatLocaleString(*source+(*length),*extent,*xml_info->content ?
     ">" : "/>");
   if (xml_info->child != (XMLTreeInfo *) NULL)
     *source=XMLTreeTagToXML(xml_info->child,source,length,extent,0,attributes);
@@ -2460,7 +2460,7 @@
         return((char *) NULL);
     }
   if (*xml_info->content != '\0')
-    *length+=FormatMagickString(*source+(*length),*extent,"</%s>",
+    *length+=FormatLocaleString(*source+(*length),*extent,"</%s>",
       xml_info->tag);
   while ((content[offset] != '\0') && (offset < xml_info->offset))
     offset++;
@@ -2538,7 +2538,7 @@
             if (xml == (char *) NULL)
               return(xml);
           }
-        length+=FormatMagickString(xml+length,extent,"<?%s%s%s?>\n",q,
+        length+=FormatLocaleString(xml+length,extent,"<?%s%s%s?>\n",q,
           *p != '\0' ? " " : "",p);
         p=root->processing_instructions[i][j];
       }
@@ -2574,7 +2574,7 @@
             if (xml == (char *) NULL)
               return(xml);
           }
-        length+=FormatMagickString(xml+length,extent,"\n<?%s%s%s?>",q,
+        length+=FormatLocaleString(xml+length,extent,"\n<?%s%s%s?>",q,
           *p != '\0' ? " " : "",p);
         p=root->processing_instructions[i][j];
       }