Index: src/org/w3c/unicorn/response/impl/DefaultResponseXBeans.java
===================================================================
--- src/org/w3c/unicorn/response/impl/DefaultResponseXBeans.java	(revision 821:32c05d83396a)
+++ src/org/w3c/unicorn/response/impl/DefaultResponseXBeans.java	(revision 827:8a781ed9826c)
@@ -1,3 +1,3 @@
-// $Id: DefaultResponseXBeans.java,v 1.5 2009-10-20 10:35:59 tgambet Exp $
+// $Id: DefaultResponseXBeans.java,v 1.6 2009-10-20 12:43:58 tgambet Exp $
 // Author: Thomas Gambet
 // (c) COPYRIGHT MIT, ERCIM and Keio, 2009.
@@ -17,9 +17,9 @@
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
-import org.w3.unicorn.x2009.x10.observationresponse.GroupType;
-import org.w3.unicorn.x2009.x10.observationresponse.ListType;
-import org.w3.unicorn.x2009.x10.observationresponse.MessageType;
-import org.w3.unicorn.x2009.x10.observationresponse.ObservationresponseDocument;
-import org.w3.unicorn.x2009.x10.observationresponse.ObservationresponseDocument.Observationresponse;
+import org.w3.x2009.x10.unicorn.observationresponse.GroupType;
+import org.w3.x2009.x10.unicorn.observationresponse.ListType;
+import org.w3.x2009.x10.unicorn.observationresponse.MessageType;
+import org.w3.x2009.x10.unicorn.observationresponse.ObservationresponseDocument;
+import org.w3.x2009.x10.unicorn.observationresponse.ObservationresponseDocument.Observationresponse;
 import org.w3c.unicorn.Framework;
 import org.w3c.unicorn.response.Group;
@@ -254,5 +254,5 @@
 
 	public Iterable<Message> getMessages(String uri, int type) {
-		return new MessageIterable(uri, type);
+		return new MessageIterable(uri, type, null);
 	}
 	
@@ -262,8 +262,26 @@
 		private Integer type;
 		private String uri;
-		
-		public MessageIterable(String uri, Integer type) {
+		private String group;
+		
+		public MessageIterable(String uri, Integer type, String group) {
 			this.uri = uri;
 			this.type = type;
+			this.group = group;
+		}
+		
+		public int size() {
+			index = 0;
+			int size = 0;
+			while (index < messages.size()) {
+				if ((uri == null || uri.equals(messages.get(index).getURI())) && 
+					(type == null || messages.get(index).getType() == type) &&
+					(group == null || group.equals(messages.get(index).getGroupName()))) {
+					index++;
+					size++;
+				}
+				index++;
+			}
+			index = 0;
+			return size;
 		}
 		
@@ -273,6 +291,8 @@
 					int x = index;
 					while (x < messages.size()) {
-						if ((uri == null || messages.get(x).getURI().equals(uri)) && 
-							(type == null || messages.get(x).getType() == type))
+						if ((uri == null || uri.equals(messages.get(x).getURI())) && 
+							(type == null || messages.get(x).getType() == type) &&
+							(group == null || group.equals(messages.get(x).getGroupName())))
+							
 							return true;
 						x++;
@@ -283,6 +303,7 @@
 				public Message next() {
 					while (index < messages.size()) {
-						if ((uri == null || messages.get(index).getURI().equals(uri)) && 
-							(type == null || messages.get(index).getType() == type)) {
+						if ((uri == null || uri.equals(messages.get(index).getURI())) && 
+							(type == null || messages.get(index).getType() == type) &&
+							(group == null || group.equals(messages.get(index).getGroupName()))) {
 							index++;
 							return messages.get(index - 1);
@@ -309,5 +330,5 @@
 
 	public Iterable<Message> getMessages(String uri, Integer type) {
-		return new MessageIterable(uri, type);
+		return new MessageIterable(uri, type, null);
 	}
 
@@ -333,3 +354,7 @@
 	}
 
+	public MessageIterable getMessages(String group) {
+		return new MessageIterable(null, null, group);
+	}
+
 }
