--- /home/cpdev/src/classpath/gnu/xml/transform/LiteralNode.java	2005-07-02 21:03:16.000000000 +0000
+++ gnu/xml/transform/LiteralNode.java	2005-06-30 05:34:21.000000000 +0000
@@ -64,8 +64,9 @@
 
   final Collection elementExcludeResultPrefixes;
 
-  LiteralNode(Node source)
+  LiteralNode(TemplateNode children, TemplateNode next, Node source)
   {
+    super(children, next);
     this.source = source;
     if (source.getNodeType() == Node.ELEMENT_NODE)
       {
@@ -94,16 +95,11 @@
 
   TemplateNode clone(Stylesheet stylesheet)
   {
-    TemplateNode ret = new LiteralNode(source);
-    if (children != null)
-      {
-        ret.children = children.clone(stylesheet);
-      }
-    if (next != null)
-      {
-        ret.next = next.clone(stylesheet);
-      }
-    return ret;
+    return new LiteralNode((children == null) ? null :
+                           children.clone(stylesheet),
+                           (next == null) ? null :
+                           next.clone(stylesheet),
+                           source);
   }
 
   void doApply(Stylesheet stylesheet, QName mode,
@@ -178,15 +174,13 @@
                       }
                   }
               }
-            Node result2 = doc.adoptNode(result);
-            if (result2 == null)
+            result = doc.adoptNode(result);
+            if (result == null)
               {
-                String msg = "Error adopting node to result tree: " +
-                  result + " (" + result.getClass().getName() + ")";
+                String msg = "Error adopting node to result tree";
                 DOMSourceLocator l = new DOMSourceLocator(context);
                 throw new TransformerException(msg, l);
               }
-            result = result2;
           }
         if (nextSibling != null)
           {
