For changing my logged status I used the following code:
    XMPPPresence *presence = [XMPPPresence presenceWithType:@"away"];
    [[self xmppStream] sendElement:presence];
But I am not getting the reference of [self xmppStream]. So I changed to the following code:
    XMPPPresence *presence = [XMPPPresence presence];
    NSXMLElement *status = [NSXMLElement elementWithName:@"status"];
    [status setStringValue:@"away"];
    [presence addChild:status];
    NSError *error = nil;
    xmppStream = [[XMPPStream alloc] init];
    [xmppStream disconnect];
    NSString *myJID = [NSString stringWithFormat:@"%@", appDelegate.jid];
    XMPPJID *JID;        
    JID = [XMPPJID jidWithString:myJID];
    NSLog(@"%@",JID);
    [xmppStream setMyJID:JID];
    xmppStream.hostName=@"talk.google.com";
    [xmppStream connect:&error];        
    [xmppStream sendElement:presence];
Still not getting the changed status. Please share your ideas. Thanks in advance.