static Element createParentElement(Path path,Element rootElement) throws ParseException {
  Preconditions.checkNotNull(path,"path");
  Preconditions.checkNotNull(rootElement,"rootElement");
  List<MetadataKey<?>> steps=path.getSteps();
  if (steps.isEmpty()) {
    return null;
  }
  Element parent=rootElement;
  for (int i=0; i < steps.size() - 1; i++) {
    ElementKey<?,?> childKey=(ElementKey<?,?>)steps.get(i);
    parent=getOrCreateChild(parent,childKey);
  }
  return parent;
}

static Element createParentElement ( Path path , Element rootElement ) throws ParseException { Preconditions . checkNotNull ( path , "path" ) ; Preconditions . checkNotNull ( rootElement , "rootElement" ) ; List < MetadataKey < ? > > steps = path . getSteps ( ) ; if ( steps . isEmpty ( ) ) { return null ; } Element parent = rootElement ; for ( int i = 0 ; i < steps . size ( ) - 1 ; i ++ ) { ElementKey < ? , ? > childKey = ( ElementKey < ? , ? > ) steps . get ( i ) ; parent = getOrCreateChild ( parent , childKey ) ; } return parent ; }
travels along the path , creating any elements that don ' t exist until it gets to the second - to - last key along the path .
