      'xml.XMLFormatException'
    );
    
-@@ -23,7 +25,7 @@
+@@ -23,14 +25,13 @@
     * @see   xp://xml.Tree#addChild
     * @test  xp://net.xp_framework.unittest.xml.NodeTest
     */

+        : htmlspecialchars($this->content)
+      ;
+    }
+  }
+?>


           $xml.= $child->getSource($indent, $encoding, $inset);
         }
         return $xml.'</'.$this->name.'>';
@@ -286,16 +291,16 @@
         }
 
         // No content and no children => close tag
-        if (0 == strlen($content)) {
-          if (!$this->children) return $xml."/>\n";
+        if (NULL === $content) {
+          if (!$children) return $xml."/>\n";
           $xml.= '>';
         } else {
