Update write xml function
Update CMakeLists file