fix tree dump for elements without attribute
add an example in the readme