}
MutableXMLStreamBuffer createBuffer() throws Exception {
MutableXMLStreamBuffer buffer = new MutableXMLStreamBuffer();
XMLStreamWriterEx writer = (XMLStreamWriterEx)buffer.createFromXMLStreamWriter();
writer.writeStartDocument();
writer.writeStartElement("foo");
writer.writeBinary(bytes, 0, bytes.length, null);
writer.writeEndElement();
writer.writeEndDocument();