void writeDocumentStart(SharedSystems systems,
            ModuleData modData, Enumeration attribEn, 
            InternalUserDataInterface usrDatIfc, boolean isActivation) throws IOException {

        // J2SE 1.4 Boolean.valueOf() is not in MIDP
        startDocument(null, null);
        docdecl(MC2Strings.tisab_mc2);

        startElement(MC2Strings.tisab_mc2);

        // auth element
        /*<!ELEMENT auth ( (auth_user, auth_passwd, user_service?) |
                (user_session_id, user_session_key, user_service) |
                auth_activate_request |
                (uin, auth_token) |
                (uin?, hardware_key+) )>
                
         <!ATTLIST auth indentingandlinebreaks %bool; "true"
            development %bool; "false"
            client_type CDATA #IMPLIED
            client_lang %language_t; #IMPLIED
            server_list_crc CDATA #IMPLIED
            server_auth_bob_crc CDATA #IMPLIED
            client_source CDATA #IMPLIED > */
        
        startElement(MC2Strings.tauth);

        if(LOG.isDebug()) {
            // add server logging if the build was made for debug
            // otherway the default value is false so I skip the attribute
            attribute(MC2Strings.adevelopment, true);
        }
        
        // indicates whether ignorable whitespace should be added to the reply
        // to make it more human readable. If false, the reply becomes smaller
        // and faster to parse
        attribute(MC2Strings.aindentingandlinebreaks, false);
        // not checked by server for external auth but it might be
        // done in the future
        attribute(MC2Strings.aclient_type, 
                           modData.getServerData().getClientType());
        
        attribute(MC2Strings.aclient_lang, 
                 systems.getSettingsIfc().getGeneralSettings()
                 .getInternalLanguage().getXMLCode());
        
        while(attribEn.hasMoreElements()) {
            MC2IsabAttribute attrib = (MC2IsabAttribute) attribEn.nextElement();
            attribute(attrib.getAttribute(), attrib.getValue());
        }
        
        if (isActivation) {
            startElement(MC2Strings.tauth_activate_request);
            endElement(MC2Strings.tauth_activate_request);
        } else {
            InternalUser usr = usrDatIfc.getInternalUser();
            if(usr.isActivated()) {
                elementWithText(MC2Strings.tuin, usr.getUIN());
            }
            Enumeration keyEnum = usr.getHardwareKeys();
            while(keyEnum.hasMoreElements()) {
                HardwareKey key = (HardwareKey) keyEnum.nextElement();
                startElement(MC2Strings.thardware_key);
                attribute(MC2Strings.atype, key.getKeyXMLType());
                text(key.getKey());
                endElement();
            }
        }
        // write_platform_property_elements();
        endElement(MC2Strings.tauth);
    } // writeDocumentStart