private static ArrayList<String> parseCollection(InputStream stream, String elementName) {
		ArrayList<String> collectionItems = new ArrayList<String>();
		
		XMLStreamReader xr;
		try {
			xr = xif.createXMLStreamReader(stream);
		} catch (XMLStreamException e) {
			xr = null;
			//TODO throw exception
		}
		
		if (xr != null) {
			try {
				while(xr.hasNext()) {
					xr.next();
					if (xr.isStartElement()) {
						if (elementName.equals(xr.getName().getLocalPart())) {
							int numAttribs = xr.getAttributeCount();
							for (int i=0; i<numAttribs; i++) {
								if ("name".equals(xr.getAttributeLocalName(i))) {
									collectionItems.add(xr.getAttributeValue(i));
								}
							}
						}
					}
				}
			} catch (XMLStreamException e) {
				//TODO probably throw an exception here
			}
		}
		
		return collectionItems;
	}