code: public int compareTo(XMLString xstr)
    {
  
      int len1 = m_length;
      int len2 = xstr.length();
      int n = Math.min(len1, len2);
      FastStringBuffer fsb = fsb();
      int i = m_start;
      int j = 0;
  
      while (n-- != 0)
      {
        char c1 = fsb.charAt(i);
        char c2 = xstr.charAt(j);
  
        if (c1 != c2)
        {
          return c1 - c2;
        }
  
        i++;
        j++;
      }
  
      return len1 - len2;
    }
docs: Compares two strings lexicographically.
  
  @param   xstr   the <code>String</code> to be compared.
  
  @return  the value <code>0</code> if the argument string is equal to
  this string; a value less than <code>0</code> if this string
  is lexicographically less than the string argument; and a
  value greater than <code>0</code> if this string is
  lexicographically greater than the string argument.
  @exception java.lang.NullPointerException if <code>anotherString</code>
  is <code>null</code>.