if (node.getNodeType() == Node.TEXT_NODE) {
buf.append(node.getNodeValue());
}
else if (node.getNodeType() == Node.ELEMENT_NODE) {
if (writer == null) {
writer = new DocumentWriter();
}
try {
buf.append(writer.writeString((Element)node, false));
}
catch (TransformerException e) {