code: public String toCanonicalXml2(XMLReader parser, InputSource inputSource, boolean stripSpace) throws Exception {
  		mStrip = stripSpace;
  		mOut = new StringWriter();
  		parser.setContentHandler(this);
  		parser.setErrorHandler(this);
  		parser.parse(inputSource);
  		return mOut.toString();
  	}
docs: Create canonical XML silently, throwing exceptions rather than displaying messages
  @param parser
  @param inputSource
  @param stripSpace
  @return
  @throws Exception