public void write(MC2Writer mc2w) throws IOException {
        
        if(LOG.isDebug()) {
            LOG.debug("TunnelMC2Request.write()", 
                    "writing tunnel request to URL: " + m_query.getUrl());
        }
        
        mc2w.attribute(MC2Strings.aurl, m_query.getUrl());
        if(m_query.getType() == TunnelRequestImpl.TYPE_HTTP_POST) {
            byte[] postData = m_query.getBody();
            if(LOG.isTrace()) {
                LOG.trace("TunnelMC2Request.write()", 
                        "found POST data with length: " + postData.length);
            }
            mc2w.startElement(MC2Strings.tpost_data);
            final String transferEncoding;
            final String postText;
            if(USE_BASE64) {
                if(LOG.isTrace()) {
                    LOG.trace("TunnelMC2Request.write()", 
                            "encoding POST data with base64");
                }
                transferEncoding = "base64";
                postText = WFBase64.encode(postData);
            } else {
                if(LOG.isTrace()) {
                    LOG.trace("TunnelMC2Request.write()", 
                            "POST data will not be encoded");
                }
                transferEncoding = "identity";
                postText = new String(postData, "UTF-8");
            }
            mc2w.attribute(MC2Strings.ate, transferEncoding);
            mc2w.text(postText);
            mc2w.endElement(MC2Strings.tpost_data);
        }
    }