code: public void normalizeSpacesInValue(int index)
      {
          // StringUtil has a method, but it works on char arrays...
          char[] attrCB = mValueBuilder.getCharBuffer();
          String normValue = StringUtil.normalizeSpaces
              (attrCB, getValueStartOffset(index), getValueStartOffset(index+1));
          if (normValue != null) {
              mAttributes[index].setValue(normValue);
          }
      }
docs: Method that can be called to force space normalization (remove
  leading/trailing spaces, replace non-spaces white space with
  spaces, collapse spaces to one) on specified attribute.
  Currently called by {@link InputElementStack} to force
  normalization of Xml:id attribute