Разобрался:
$xmlwriter = new xmlWriter();
$xmlwriter->openMemory();
$xmlwriter->setIndent(true);
$xmlwriter->startDocument('1.0','UTF-8');
$xmlwriter->startElement('sphinx:docset');
$xmlwriter->startElement('sphinx:schema');
$xmlwriter->startElement('sphinx:field');
$xmlwriter->writeAttribute("name", "content");
$xmlwriter->endElement(); // field
$xmlwriter->startElement('sphinx:attr');
$xmlwriter->writeAttribute("name", "path");
$xmlwriter->writeAttribute("type", "string");
$xmlwriter->endElement(); // attr
$xmlwriter->endElement(); // schema
$xmlwriter->startElement('sphinx:document');
$xmlwriter->writeAttribute("id", 1);
$xmlwriter->startElement("content");
$xmlwriter->text("TEST_CONTENT2");
$xmlwriter->endElement(); // field
$xmlwriter->startElement("path");
$xmlwriter->text("TEST_ATTRIBUTE2");
$xmlwriter->endElement(); // attr
$xmlwriter->endElement(); // doc
$xmlwriter->endElement(); // docset