Generate stage from xml file (incompleted)