private void deleteChildren(Element container){
  while (container.hasChildNodes()) {
    container.removeChild(container.getLastChild());
  }
}

private void deleteChildren ( Element container ) { while ( container . hasChildNodes ( ) ) { container . removeChild ( container . getLastChild ( ) ) ; } }
delete the children of the element .
