 				homeVoiceNode.NUMBER = homeVoiceNumber;
 				vcardExtNode.appendChild( homeVoiceNode );
 			}
+			
+			if ( avatar != null && _avatarType != null)
+			{
+				var avatarNode:XML = <PHOTO/>
+				var avatarBase64:String;
+
+				try
+				{
+					avatarBase64 = Base64.encodeByteArray(avatar);
+				}
+				catch(err:Error)
+				{
+					throw new Error("VCard:saveVCard Error encoding bytes " + err.getStackTrace());
+				}
+				
+				try
+				{
+					var binaryNode:XML = <BINVAL/>;
+					binaryNode.appendChild(avatarBase64);
+					avatarNode.appendChild(binaryNode);
+				}
+				catch(err:Error)
+				{
+					throw new Error("VCard:saveVCard Error converting bytes to string " + err.message);
+				}
+
+				var typeNode:XML = <TYPE/>;
+				typeNode.appendChild(_avatarType);
+				avatarNode.appendChild(typeNode);
+					
+				vcardExtNode.appendChild( avatarNode );
+			}
 
 			iq.addExtension( vcardExt );
 			connection.send( iq );

		}

		/**
		 * Get the byte array to be used with a Loader.loadBytes or similar.
		 * @return Avatar bytes if any
		 */
		public function get avatar():ByteArray
		{
			return _imageBytes;
		}

		/**
		 * Deserializes the incoming IQ to fill the values of this vcard.
		 * @param iq

		 *
		 */
		private var _avatar:DisplayObject;
		
		/**
		 *
		 * @hint for saving avatar
		 */
		private var _avatarType:String;

		/**
		 *
