Esempio n. 1
0
  /**
   * Serializes a DOM Node into a String.
   *
   * @param node Node
   * @param omitDecl omit xml declaration
   * @return String
   */
  public static String convertToString(Node node, boolean omitDecl) {
    // create a new string writer
    StringWriter writer = new StringWriter();
    // serialize the node to the writer
    serialize(node, writer, omitDecl);

    return writer.toString();
  }