code: public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
          appendNodeDetail(buf, nodeDetail.getNode(), true);
          buf.append(" at ").append(nodeDetail.getXpathLocation());
      }
docs: Convert a Node into a simple String representation
  and append to StringBuffer
  @param buf
  @param nodeDetail