diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 6548852917..95fb370b04 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -482,6 +482,12 @@ XMLNode::attribute_value() XMLNode* XMLNode::add_content(const string& c) { + if (c.empty ()) { + /* this would add a "" child, leading to invalid XML. + * Also in XML, empty string content is equivalent to no content. + */ + return NULL; + } return add_child_copy(XMLNode (string(), c)); }