code: private static List<Element> createCollectionElementDBs(final IStorage pDatabase,
          final Document document, final IBackendFactory pStorageFac, final IRevisioning pRevision)
          throws WebApplicationException, TTException {
          final List<Element> collectionsEls = new ArrayList<Element>();
          for (final String res : pDatabase.listResources()) {
              final Element elRes = document.createElement("resource");
              // Getting the name
              elRes.setAttribute("name", res);
  
              // get last revision from given db name
              final DatabaseRepresentation dbWorker =
                  new DatabaseRepresentation(pDatabase, pStorageFac, pRevision);
              final String lastRevision = Long.toString(dbWorker.getLastRevision(res.toString()));
  
              elRes.setAttribute("lastRevision", lastRevision);
              collectionsEls.add(elRes);
          }
  
          return collectionsEls;
      }
docs: This method creates the XML element containing a collection. This
  collection contains the available resources which are children of the
  database.
  
  
  @param pDatabase
  path where the data must be stored
  @param document
  The XML {@link Document} instance.
  @return A list of XML {@link Element} as the collection.
  @throws TTException
  @throws WebApplicationException