change read_kable_as_xml for the entire package
diff --git a/R/add_header_above.R b/R/add_header_above.R
index 5384f4d..04e51bd 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -38,7 +38,7 @@
 htmlTable_add_header_above <- function(kable_input, header, bold, italic) {
   if (is.null(header)) return(kable_input)
   kable_attrs <- attributes(kable_input)
-  kable_xml <- read_xml(as.character(kable_input), options = c("COMPACT"))
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_xml_thead <- xml_tpart(kable_xml, "thead")
 
   header <- standardize_header_input(header)
diff --git a/R/add_indent.R b/R/add_indent.R
index cb4c141..4ae84da 100644
--- a/R/add_indent.R
+++ b/R/add_indent.R
@@ -54,7 +54,7 @@
 add_indent_html <- function(kable_input, positions) {
   kable_attrs <- attributes(kable_input)
 
-  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   group_header_rows <- attr(kable_input, "group_header_rows")
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index 7f21996..3b13997 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -33,7 +33,7 @@
 
 collapse_rows_html <- function(kable_input, columns) {
   kable_attrs <- attributes(kable_input)
-  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   kable_dt <- rvest::html_table(xml2::read_html(as.character(kable_input)))[[1]]
diff --git a/R/column_spec.R b/R/column_spec.R
index 7af7431..8381899 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -42,7 +42,7 @@
 
 column_spec_html <- function(kable_input, column, width, bold, italic, monospace) {
   kable_attrs <- attributes(kable_input)
-  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   group_header_rows <- attr(kable_input, "group_header_rows")
diff --git a/R/group_rows.R b/R/group_rows.R
index 7e2df67..79f3d6f 100644
--- a/R/group_rows.R
+++ b/R/group_rows.R
@@ -46,7 +46,7 @@
 group_rows_html <- function(kable_input, group_label, start_row, end_row,
                             label_row_css) {
   kable_attrs <- attributes(kable_input)
-  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   group_header_rows <- attr(kable_input, "group_header_rows")
diff --git a/R/magic_mirror.R b/R/magic_mirror.R
index ade1472..93f6860 100644
--- a/R/magic_mirror.R
+++ b/R/magic_mirror.R
@@ -93,7 +93,7 @@
 #' @param kable_input The output of kable
 magic_mirror_html <- function(kable_input){
   kable_info <- list()
-  kable_xml <- read_xml(as.character(kable_input))
+  kable_xml <- read_kable_as_xml(kable_input)
   # Caption
   kable_info$caption <- xml_text(xml_child(kable_xml, "caption"))
   # Contents
diff --git a/R/row_spec.R b/R/row_spec.R
index 75e301b..0c71060 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -36,7 +36,7 @@
 
 row_spec_html <- function(kable_input, row, bold, italic) {
   kable_attrs <- attributes(kable_input)
-  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_xml <- read_kable_as_xml(kable_input)
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   group_header_rows <- attr(kable_input, "group_header_rows")