String tmp = result.toString(); int close = tmp.lastIndexOf('>'); if (close == -1) { close = tmp.length(); } result.insert(close, getNamespaceDeclarations()); return result;
    private StringBuffer getXSLTBase() {        return new StringBuffer(XML_DECLARATION)            .append(XSLT_START);    }