solve the XML declaration problem
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index d260362..7f21996 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -64,8 +64,7 @@
     }
   }
 
-  out <- structure(as.character(kable_xml), format = "html",
-                   class = "knitr_kable")
+  out <- as_kable_xml(kable_xml)
   attributes(out) <- kable_attrs
   return(out)
 }