#include <libxml/xmlwriter.h>

int
main (int argc, char **argv)
{
  xmlTextWriterPtr writer;

  writer = xmlNewTextWriterFilename ("/tmp/foo.xml", 0);
  if (!writer) return 1;
  if (xmlTextWriterStartDocument (writer, "1.0", NULL, NULL)) return 1;
  if (xmlTextWriterStartElement (writer, "foo")) return 1;
  if (xmlTextWriterWriteFormatAttribute (writer, "foo", "%s", "\x0B")) return 1;
  if (xmlTextWriterWriteFormatString (writer, "%s", "\x0B")) return 1;
  if (xmlTextWriterEndElement (writer)) return 1;
  if (xmlTextWriterEndDocument (writer)) return 1;
  xmlFreeTextWriter (writer);

  return 0;
}
