xml UPDATE backup/restore input line
diff --git a/src/xml.c b/src/xml.c
index aa35fb4..1204d13 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1184,8 +1184,9 @@
         xmlctx->dynamic = 0;
     }
 
-    /* backup in current pointer only */
-    backup->in = (void *)xmlctx->in->current;
+    /* backup in */
+    backup->b_current = xmlctx->in->current;
+    backup->b_line = xmlctx->in->line;
 
     /* duplicate elements */
     backup->elements.objs = malloc(xmlctx->elements.size * sizeof(struct lyxml_elem));
@@ -1220,8 +1221,9 @@
     /* free ns */
     lyxml_ns_rm_all(xmlctx);
 
-    /* restore in current pointer */
-    xmlctx->in->current = (void *)backup->in;
+    /* restore in */
+    xmlctx->in->current = backup->b_current;
+    xmlctx->in->line = backup->b_line;
     backup->in = xmlctx->in;
 
     /* restore backup */