Index: protocols/jabber/io.c
===================================================================
--- protocols/jabber/io.c	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
+++ protocols/jabber/io.c	(revision bb95d43e263530805224005ca246addb6bb199fa)
@@ -44,4 +44,13 @@
 	struct jabber_data *jd = ic->proto_data;
 	gboolean ret;
+	
+	if( jd->flags & JFLAG_XMLCONSOLE )
+	{
+		char *msg;
+		
+		msg = g_strdup_printf( "TX: %s", buf );
+		imcb_buddy_msg( ic, JABBER_XMLCONSOLE_HANDLE, msg, 0, 0 );
+		g_free( msg );
+	}
 	
 	if( jd->tx_len == 0 )
@@ -484,5 +493,25 @@
 }
 
+static xt_status jabber_xmlconsole( struct xt_node *node, gpointer data )
+{
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
+	
+	if( jd->flags & JFLAG_XMLCONSOLE )
+	{
+		char *msg, *pkt;
+		
+		pkt = xt_to_string( node );
+		msg = g_strdup_printf( "RX: %s", pkt );
+		imcb_buddy_msg( ic, JABBER_XMLCONSOLE_HANDLE, msg, 0, 0 );
+		g_free( msg );
+		g_free( pkt );
+	}
+	
+	return XT_NEXT;
+}
+
 static const struct xt_handler_entry jabber_handlers[] = {
+	{ NULL,                 "stream:stream",        jabber_xmlconsole },
 	{ "stream:stream",      "<root>",               jabber_end_of_stream },
 	{ "message",            "stream:stream",        jabber_pkt_message },
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
+++ protocols/jabber/jabber.c	(revision bb95d43e263530805224005ca246addb6bb199fa)
@@ -226,4 +226,7 @@
 	int st;
 	
+	if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
+		return jabber_write( ic, message, strlen( message ) );
+	
 	bud = jabber_buddy_by_jid( ic, who, 0 );
 	
@@ -311,4 +314,13 @@
 static void jabber_add_buddy( struct im_connection *ic, char *who, char *group )
 {
+	struct jabber_data *jd = ic->proto_data;
+	
+	if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
+	{
+		jd->flags |= JFLAG_XMLCONSOLE;
+		imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
+		return;
+	}
+	
 	if( jabber_add_to_roster( ic, who, NULL ) )
 		presence_send_request( ic, who, "subscribe" );
@@ -317,4 +329,13 @@
 static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group )
 {
+	struct jabber_data *jd = ic->proto_data;
+	
+	if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
+	{
+		jd->flags &= ~JFLAG_XMLCONSOLE;
+		/* FIXME imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); */
+		return;
+	}
+	
 	/* We should always do this part. Clean up our administration a little bit. */
 	jabber_buddy_remove_bare( ic, who );
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
+++ protocols/jabber/jabber.h	(revision bb95d43e263530805224005ca246addb6bb199fa)
@@ -32,14 +32,15 @@
 typedef enum
 {
-	JFLAG_STREAM_STARTED = 1,	/* Set when we detected the beginning of the stream
+	JFLAG_STREAM_STARTED = 1,       /* Set when we detected the beginning of the stream
 	                                   and want to do auth. */
-	JFLAG_AUTHENTICATED = 2,	/* Set when we're successfully authenticatd. */
-	JFLAG_STREAM_RESTART = 4,	/* Set when we want to restart the stream (after
+	JFLAG_AUTHENTICATED = 2,        /* Set when we're successfully authenticatd. */
+	JFLAG_STREAM_RESTART = 4,       /* Set when we want to restart the stream (after
 	                                   SASL or TLS). */
-	JFLAG_WAIT_SESSION = 8,		/* Set if we sent a <session> tag and need a reply
+	JFLAG_WAIT_SESSION = 8,	        /* Set if we sent a <session> tag and need a reply
 	                                   before we continue. */
-	JFLAG_WAIT_BIND = 16,		/* ... for <bind> tag. */
-	JFLAG_WANT_TYPING = 32,		/* Set if we ever sent a typing notification, this
+	JFLAG_WAIT_BIND = 16,           /* ... for <bind> tag. */
+	JFLAG_WANT_TYPING = 32,         /* Set if we ever sent a typing notification, this
 	                                   activates all XEP-85 related code. */
+	JFLAG_XMLCONSOLE = 64,          /* If the user added an xmlconsole buddy. */
 } jabber_flags_t;
 
@@ -56,8 +57,4 @@
 } jabber_buddy_flags_t;
 
-#define JABBER_PORT_DEFAULT "5222"
-#define JABBER_PORT_MIN 5220
-#define JABBER_PORT_MAX 5229
-
 struct jabber_data
 {
@@ -124,4 +121,10 @@
 	struct jabber_buddy *me;
 };
+
+#define JABBER_XMLCONSOLE_HANDLE "xmlconsole"
+
+#define JABBER_PORT_DEFAULT "5222"
+#define JABBER_PORT_MIN 5220
+#define JABBER_PORT_MAX 5229
 
 /* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
Index: protocols/jabber/xmltree.c
===================================================================
--- protocols/jabber/xmltree.c	(revision 6286f80d6dc1dc4cb8106b4e209a8578d7cebe56)
+++ protocols/jabber/xmltree.c	(revision bb95d43e263530805224005ca246addb6bb199fa)
@@ -188,6 +188,4 @@
 			                       g_strcasecmp( xt->handlers[i].parent, "<root>" ) == 0 ) ) )
 			{
-				xt_print( node );
-				
 				st = xt->handlers[i].func( node, xt->data );
 				
