14#include <libxml/tree.h>
15#include <libxml/xmlwriter.h>
23 auto const buf = xmlBufferCreate();
26 throw std::bad_alloc();
28 auto const writer = xmlNewTextWriterMemory(buf, 0);
29 if (writer ==
nullptr)
31 throw std::bad_alloc();
34 xmlFreeTextWriter(writer);
35 std::string_view s(
reinterpret_cast<char const*
>(xmlBufferContent(buf)), xmlBufferLength(buf));
36 OUString rv = OStringToOUString(s, RTL_TEXTENCODING_ISO_8859_1);
OUString dumpXmlToString(F f)