code: public static String getNodeTitle(Node node) {
          String result = null;
          try {
              Property title = node.getProperty(JCR_TITLE);
              if (title != null) {
                  result = title.getString();
              }
          } catch (RepositoryException rex) {
              LOG.error(rex.getMessage(), rex);
          }
          return result;
      }
docs: Retrieves the 'jcr:title' property value from a node
  
  @param node
  @return the title value or <code>null</code> if not present