code: public NodeRepresentation getNodeRepresentation(Node node, String mediaTypeHint) throws RepositoryException
     {
  
        NodeRepresentationFactory factory = factory(node);
        if (factory != null)
           return factory.createNodeRepresentation(node, mediaTypeHint);
        else
           return new DocumentViewNodeRepresentation(node);
     }
docs: Get NodeRepresentation for given node. String mediaTypeHint can be used as external information
  for representation. By default node will be represented as doc-view.
  
  @param node
  the jcr node.
  @param mediaTypeHint
  the mimetype hint or null if not known.
  @return the NodeRepresentation.
  @throws RepositoryException