tostring implemenation for all elements and diagrams