Here you can find the source of removeUserData(Node node, String key)
public static void removeUserData(Node node, String key)
//package com.java2s; import org.w3c.dom.Node; public class Main { public static void removeUserData(Node node, String key) { node.setUserData(key, null, null); Node child = node.getFirstChild(); while (child != null) { removeUserData(child, key);/*from w w w.ja va 2 s . c om*/ child = child.getNextSibling(); } } }