(function () { /* Begin of privacy scope */
    "use strict";

    gpf.declareTests({

        "toConstNode": [

            function (test) {
                test.title("Convert a simple object into IXMLConstNode");
                var
                    root = new gpf.xml.ConstNode({
                        att1: "Hello",
                        att2: "World!",
                        child1: {
                            att3: 123
                        }
                    }),
                    child;
                test.equal(root.localName(), "root", "Root name");
                test.equal(root.attributes("att1"), "Hello", "First attribute");
                test.like(root.attributes(), {
                    att1: "Hello",
                    att2: "World!"
                }, "All attributes");
                child = root.children(0);
                test.notEqual(child, null, "Get first child");
                test.equal(child.parentNode(), root, "Parent points to root");
                test.equal(child.localName(), "child1", "Child name");
                test.equal(child.attributes("att3"), 123, "Child attribute");
                test.equal(child.attributes("att4"), undefined,
                    "Child unknown attribute");
                test.equal(child.nextSibling(), null, "No next sibling");
                test.equal(child.previousSibling(), null,
                    "No previous sibling");
            },

            function (test) {
                test.title("Convert an object with arrays into IXMLConstNode");
                var
                    root = new gpf.xml.ConstNode({
                        array1: [ "Hello", "World!" ],
                        array2: [{
                            att1: "Hello",
                            att2: "World!"
                        }, "Mixed"]
                    }, "complex"),
                    array1, child, array2;
                test.equal(root.localName(), "complex", "Root name");
                test.equal(root.children().length, 2, "Two children");
                array1 = root.children(0);
                test.notEqual(array1, null, "> First child");
                test.equal(array1.localName(), "array1", "> First child name");
                test.equal(array1.children().length, 2,
                    "> First child children count");
                test.log("> Processing first child children");
                child = array1.children(0);
                test.notEqual(child, null, "  > Child obtained");
                test.equal(child.localName(), "item", "  > Child name");
                test.equal(child.children().length, 0,
                    "  > Children count");
                test.equal(child.nodeValue(),
                    "Hello", "  > First child value");
                test.equal(array1.children(1).nodeValue(),
                    "World!", "  > Second child value");
                test.log("> Processing second child");
                array2 = array1.nextSibling();
                test.notEqual(array2, null,
                    "> Accessible using nextSibling on first child");
                test.equal(array2.previousSibling(), array1,
                    "> First child accessible using previousSibling");
                test.log("> Processing second child children");
                child = array2.children(0);
                test.notEqual(child, null, "  > First child obtained");
                test.equal(child.localName(), "item", "    > First child name");
                test.equal(child.attributes("att1"), "Hello",
                    "    > First child attribute att1");
                test.equal(child.attributes("att2"), "World!",
                    "    > First child attribute att2");
                test.equal(child.attributes("att3"), undefined,
                    "    > First child unknown attribute att3");
                child = child.nextSibling();
                test.notEqual(child, null, "  > Second child obtained");
                test.equal(child.nodeValue(), "Mixed",
                    "    > Second child value");
            }

        ],

        "toXML": [

            function (test) {
                test.title("Convert a simple object into IXMLConstNode");
                var
                    root = new gpf.xml.ConstNode({
                        att1: "Hello",
                        att2: "World!",
                        child1: {
                            att3: 123
                        }
                    }),
                    stream = gpf.stringToStream(),
                    contentHandler = new gpf.xml.Writer(stream);
                root.toXml(contentHandler);
                test.equal(gpf.stringFromStream(stream), "<root att1=\"Hello" +
                    "\" att2=\"World!\"><child1 att3=\"123\"/></root>",
                    "XML is well formed");
            },

            function (test) {
                test.title("Convert an object with arrays into IXMLConstNode");
                var
                    root = new gpf.xml.ConstNode({
                        array1: [ "Hello", "World!" ],
                        array2: [{
                            att1: "Hello",
                            att2: "World!"
                        }, "Mixed"]
                    }, "complex"),
                    stream = gpf.stringToStream(),
                    contentHandler = new gpf.xml.Writer(stream);
                root.toXml(contentHandler);
                test.equal(gpf.stringFromStream(stream),  "<complex><array1><" +
                    "item>Hello</item><item>World!</item></array1><array2><it" +
                    "em att1=\"Hello\" att2=\"World!\"/><item>Mixed</item></a" +
                    "rray2></complex>", "XML is well formed");
            }

        ]

    });

})(); /* End of privacy scope */

@@ -4687,35 +4687,57 @@
 l(contentHandler
-);%0A
+, function (event) %7B%0A    
                 
@@ -4751,35 +4751,166 @@
 ual(
-gpf.stringFromStream(stream
+event.type(), %22ready%22, %22Completed%22);%0A                    gpf.stringFromStream(stream, function (event) %7B%0A                        test.equal(event.get(%22buffer%22
 ), %22
@@ -4951,16 +4951,24 @@
         
+       
+ 
 %22%5C%22 att2
@@ -5031,16 +5031,24 @@
         
+        
 %22XML is 
@@ -5054,32 +5054,76 @@
  well formed%22);%0A
+                    %7D);%0A                %7D);%0A
             %7D,%0A%0A
@@ -5707,19 +5707,41 @@
 tHandler
-);%0A
+, function (event) %7B%0A    
         
@@ -5763,35 +5763,166 @@
 ual(
-gpf.stringFromStream(stream
+event.type(), %22ready%22, %22Completed%22);%0A                    gpf.stringFromStream(stream, function (event) %7B%0A                        test.equal(event.get(%22buffer%22
 ),  
@@ -5940,24 +5940,28 @@
 array1%3E%3C%22 +%0A
+    
             
@@ -6021,20 +6021,16 @@
 %3E%3Carray2
-%3E%3Cit
 %22 +%0A    
@@ -6045,17 +6045,25 @@
         
-%22
+    %22%3E%3Cit
 em att1=
@@ -6102,24 +6102,16 @@
 %3EMixed%3C/
-item%3E%3C/a
 %22 +%0A    
@@ -6126,17 +6126,29 @@
         
-%22
+    %22item%3E%3C/a
 rray2%3E%3C/
@@ -6173,32 +6173,76 @@
  well formed%22);%0A
+                    %7D);%0A                %7D);%0A
             %7D%0A%0A 

FIX #24 and FIX #25