private void writeNameValuePair(String uri, String localName, String qualifiedName, String value) throws SAXException {
        try {
            writeName(uri, localName, qualifiedName);
            output.write("=".getBytes("UTF-8"));
            output.write("\"".getBytes("UTF-8"));
            if (value != null) {
                for (int i = 0; i < value.length(); i++) {
                    switch (value.charAt(i)) {
                        case '"':
                            output.write("&quot;".getBytes("UTF-8"));
                            break;
                        case '&':
                            output.write("&amp;".getBytes("UTF-8"));
                            break;
                        case '<':
                            output.write("&lt;".getBytes("UTF-8"));
                            break;
                        case '>':
                            output.write("&gt;".getBytes("UTF-8"));
                            break;
                        default:
                            output.write(Character.toString(value.charAt(i)).getBytes("UTF-8"));
                    }
                }
            }
            output.write("\"".getBytes("UTF-8"));
        } catch (Exception e) {
            throw new SAXException(e);
        }
    }