Java tutorial
//package com.java2s; import org.w3c.dom.Node; public class Main { /** * Removes the given attribute from the node * @param doc * @param node * @param attrName */ public static void removeAttr(Node node, String attrName) { if (node.getAttributes().getNamedItem(attrName) != null) node.getAttributes().removeNamedItem(attrName); } }