aboutsummaryrefslogtreecommitdiffstats
path: root/python/sandcrawler/xml.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/sandcrawler/xml.py')
-rw-r--r--python/sandcrawler/xml.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/sandcrawler/xml.py b/python/sandcrawler/xml.py
new file mode 100644
index 0000000..83d53d4
--- /dev/null
+++ b/python/sandcrawler/xml.py
@@ -0,0 +1,6 @@
+import xml.etree.ElementTree as ET
+
+
+def xml_reserialize(raw: bytes) -> str:
+ root = ET.fromstring(raw)
+ return '<?xml version="1.0" encoding="UTF-8"?>\n' + ET.tostring(root, encoding="unicode")