/* 'mxml_write_string()' - Write a string, escaping & and < as needed.  */
static int mxml_write_string(const char *s, void *p, _mxml_putc_cb_t putc_cb)
/* 'mxml_write_string()' - Write a string, escaping & and < as needed.  */
static int mxml_write_string(const char *s, void *p, _mxml_putc_cb_t putc_cb)
{
  const char	*name;
  while (*s)
  {
    if ((name = mxmlEntityGetName(*s)) != NULL)
    {
      if ((*putc_cb)('&', p) < 0)
        return (-1);
      while (*name)
      {
	if ((*putc_cb)(*name, p) < 0)
          return (-1);
        name ++;
      }
      if ((*putc_cb)(';', p) < 0)
        return (-1);
    }
    else if ((*putc_cb)(*s, p) < 0)
      return (-1);
    s ++;
  }
  return (0);
}