-working example of generation class from root node and element