private void registerElement(Element element){
  elements.add(element);
  for (  Element child : element.getChildren()) {
    registerElement(child);
  }
}

private void registerElement ( Element element ) { elements . add ( element ) ; for ( Element child : element . getChildren ( ) ) { registerElement ( child ) ; } }
adds element and it children to tree
