+ if (buf_ret == NULL || bufsize_ret == NULL)
+ return WIMLIB_ERR_INVALID_PARAM;
+
+ xml_reshdr = &wim->hdr.xml_data_reshdr;
+
+ DEBUG("Reading XML data.");
+ *bufsize_ret = xml_reshdr->uncompressed_size;
+ return wim_reshdr_to_data(xml_reshdr, wim, buf_ret);
+}
+
+WIMLIBAPI int
+wimlib_extract_xml_data(WIMStruct *wim, FILE *fp)
+{
+ int ret;
+ void *buf;
+ size_t bufsize;
+
+ ret = wimlib_get_xml_data(wim, &buf, &bufsize);