Here you can find the source of removeDefaultNameSpaceAttributes(final Element element)
public static Element removeDefaultNameSpaceAttributes(final Element element)
//package com.java2s; // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell import org.w3c.dom.Element; public class Main { public static Element removeDefaultNameSpaceAttributes(final Element element) { Element ret = element;// w w w.j av a2 s. c om ret.removeAttribute("xmlns:gmi"); ret.removeAttribute("xmlns:gco"); ret.removeAttribute("xmlns:gmd"); ret.removeAttribute("xmlns:gml"); ret.removeAttribute("xmlns:gmx"); ret.removeAttribute("xmlns:ows"); ret.removeAttribute("xmlns:xsi"); ret.removeAttribute("xmlns:xlink"); return ret; } }