//------------------------------------------------------------------------------
//------------------------------------------------------- Message::asXMLString()
//------------------------------------------------------------------------------
-std::string Message::asXMLString() const throw() {
+std::string Message::asXMLString(bool sortAttributes) const throw() {
anna::xml::Node root("root");
- return anna::xml::Compiler().apply(asXML(&root));
+
+ anna::xml::Compiler::Mode::_v mode = sortAttributes ? anna::xml::Compiler::Mode::Sort : anna::xml::Compiler::Mode::Visual;
+ return anna::xml::Compiler().apply(asXML(&root), mode);
}