code: public Node build() {
          ContainerNode ret = null;
  
          if (nodeType == NodeType.Component) {
              ret = new Component();
              ((Component) ret).setComponentType(componentType);
          } else if (nodeType == NodeType.Consumer) {
              ret = new Consumer();
              ((Consumer) ret).setEndpointType(endpointType);
          } else if (nodeType == NodeType.Producer) {
              ret = new Producer();
              ((Producer) ret).setEndpointType(endpointType);
          }
          ret.setCorrelationIds(correlationIds);
          ret.setOperation(operation);
          ret.setProperties(properties);
          ret.setUri(uri);
          ret.setDuration(duration);
          ret.setTimestamp(timestamp);
  
          for (int i = 0; i < nodes.size(); i++) {
              ret.getNodes().add(nodes.get(i).build());
          }
  
          // Check if template has been supplied for URI
          NodeUtil.rewriteURI(ret);
  
          return ret;
      }
docs: This method builds the node hierarchy.
  
  @return The node hierarchy