diff --git a/src/gajim-remote.py b/src/gajim-remote.py
index 49ab144b73b9cc8d8777c61a2727c6bd5f0648b3..934f8b3ffca966f44c22896d4f63210c881f559e 100755
--- a/src/gajim-remote.py
+++ b/src/gajim-remote.py
@@ -236,6 +236,13 @@ class GajimRemote:
 						(_('account'), _('Starts chat, using this account'), True)
 					]
 				],
+			'send_xml': [
+					_('Send custom XML'), 
+					[
+						('xml', _('XML to send'), True),
+						('account', _('Account, if not, xml\'ll be send to all your accounts'), False)
+					]
+				],
 			}
 		if self.argv_len  < 2 or \
 			sys.argv[1] not in self.commands.keys(): # no args or bad args
diff --git a/src/remote_control.py b/src/remote_control.py
index 7e723dc8b9d43f39d6526f2094aad39a6e6b19c9..82dbc54b63d3dfdf277e7d9cc8439c236e40f710 100644
--- a/src/remote_control.py
+++ b/src/remote_control.py
@@ -171,6 +171,7 @@ class SignalObject(DbusPrototype):
 				self.get_status,
 				self.get_status_message,
 				self.start_chat,
+				self.send_xml,
 			])
 
 	def raise_signal(self, signal, arg):
@@ -605,6 +606,14 @@ class SignalObject(DbusPrototype):
 		NewChatDialog(account)
 		return True
 
+	def send_xml(self, *args):
+		xml, account = self._get_real_arguments(args, 2)
+		if account:
+			gajim.connections[account[0]].send_stanza(xml)
+		else:
+			for acc in gajim.contacts.get_accounts():
+				gajim.connections[acc].send_stanza(xml)
+
 	if dbus_support.version[1] >= 30 and dbus_support.version[1] <= 40:
 		method = dbus.method
 		signal = dbus.signal
@@ -636,3 +645,4 @@ class SignalObject(DbusPrototype):
 	account_info = method(INTERFACE)(account_info)
 	get_unread_msgs_number = method(INTERFACE)(get_unread_msgs_number)
 	start_chat = method(INTERFACE)(start_chat)
+	send_xml = method(INTERFACE)(send_xml)