public void insertChild(Node node,int index){
  node.detachFromParent();
  node.parentNode=this;
  try {
    initChildNodes(node);
    childNodes.add(index,node);
  }
 catch (  IndexOutOfBoundsException ignore) {
    throw new LagartoDOMException("Invalid node index: " + index);
  }
  reindexChildren();
}

public void insertChild ( Node node , int index ) { node . detachFromParent ( ) ; node . parentNode = this ; try { initChildNodes ( node ) ; childNodes . add ( index , node ) ; } catch ( IndexOutOfBoundsException ignore ) { throw new LagartoDOMException ( "Invalid node index: " + index ) ; } reindexChildren ( ) ; }
inserts node at given index .
