Added "mode" to <environment>'s _toxml method