add to_xml function to stages class
add DocString