/**
   * Populates CloudBlobContainer objects from the XMLStreamReader, reader must be at Start element
   * of ContainersElement
   *
   * @param xmlr the XMLStreamReader object
   * @param serviceClient the CloudBlobClient associated with the objects.
   * @return an ArrayList of CloudBlobContainer from the stream.
   * @throws XMLStreamException if there is a parsing exception
   * @throws ParseException if a date value is not correctly encoded
   * @throws URISyntaxException
   * @throws StorageException
   */
  public static ArrayList<CloudBlobContainer> readContainers(
      final XMLStreamReader xmlr, final CloudBlobClient serviceClient)
      throws XMLStreamException, ParseException, URISyntaxException, StorageException {
    int eventType = xmlr.getEventType();
    xmlr.require(XMLStreamConstants.START_ELEMENT, null, BlobConstants.CONTAINERS_ELEMENT);

    final ArrayList<CloudBlobContainer> containers = new ArrayList<CloudBlobContainer>();

    eventType = xmlr.next();
    while (eventType == XMLStreamConstants.START_ELEMENT
        && xmlr.hasName()
        && BlobConstants.CONTAINER_ELEMENT.equals(xmlr.getName().toString())) {
      containers.add(BlobDeserializationHelper.readContainer(xmlr, serviceClient));
      eventType = xmlr.next();
    }

    xmlr.require(XMLStreamConstants.END_ELEMENT, null, BlobConstants.CONTAINERS_ELEMENT);
    return containers;
  }