t.getTransformer().setOutputProperty("indent", "yes");
t.setResult(new StreamResult(System.out));
// Write events to the serializer
t.startDocument();
t.startElement("", "out", "out", new AttributesImpl());
t.characters(new char[]{'a','&','b'}, 0, 3);
t.processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
t.characters(new char[]{'<','M','/', '>'}, 0, 4);
t.processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
t.characters(new char[]{'y','&','z'}, 0, 3);