code: public static void removeChildrenFrom(Element element) {
          if (element != null) {
              while (element.firstChild != null) {
                  element.removeChild(element.firstChild);
              }
          }
      }
docs: Removes all child elements from {@code element}