Refactored element creation to factory method to allow tag name base creation of different nodes.
Generalized interfaces and fixed raw type.
Fixed types of root selection (must not return interface to assure type safety).