private final void writeAttributes(final Attributes atts)
                throws IOException
        {
            StringBuffer sb = new StringBuffer();
            int len = atts.getLength();
            for (int i = 0; i < len; i++) {
                sb.append(' ')
                        .append(atts.getLocalName(i))
                        .append("=\"")
                        .append(esc(atts.getValue(i)))
                        .append('\"');
            }
            w.write(sb.toString());
        }