code: protected function formatScalarValue($value)
      {
          if ($value === true) {
              return 'true';
          }
          if ($value === false) {
              return 'false';
          }
          if (is_float($value)) {
              return StringHelper::floatToString($value);
          }
          return (string) $value;
      }
docs: Formats scalar value to use in XML text node.
  
  @param int|string|bool|float $value a scalar value.
  @return string string representation of the value.
  @since 2.0.11