code: private Element findRootFolderElement( Document dom )
      {
          NodeList list = dom.getElementsByTagNameNS( "*", "folder" );
  
          final String localRootId = getRootId(); // cache it also in this method
  
          for ( int i = 0; i < list.getLength(); i++ ) {
              Element e = ( Element ) list.item( i );
              if ( e.getAttribute( "id" ).equals( localRootId ) ) {
                  return e;
              }
          }
          throw new CStorageException( "Could not find root folder with id=" + localRootId );
      }
docs: Gets the element corresponding to the root folder in the DOM.
  
  @param dom document where the root element is to be found
  @return the element corresponding to the root folder