 		 */
 		protected function sendXML( someData:* ):void
 		{
+			someData = someData is XML ? XML( someData ).toXMLString() : someData;
+			
 			var bytedata:ByteArray = new ByteArray();
 			bytedata.writeUTFBytes(someData);
 			

				}
				else
				{
					dispatchError("Authentication Error", "", "", 401);
					disconnect();
				}

		{
			// TODO: Build a proper extension which takes care XML building.
			var ask:XML = <compress xmlns="http://jabber.org/protocol/compress"><method>zlib</method></compress>;
			sendXML(ask); // XML
		}

		/**
