I want to remove namespace from XML in Java. Can you pls guide on what needs to be done. Can use DOM parser but that would be a node by node parsing. I want to know if there is some code wherein all the namespace(mig:) can be removed from the entire XML.
My XML :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mig:menu-compare xmlns:mig="http://www..com/migration/" xmlns:xsi="http://www..org/2001/XMLSchema-instance" xsi:schemaLocation="http://www..com/migration">
<mig:menu-info>
<mig:menu type="ons" name="HRDM"/>
<mig:menu type="ux" name="ARD"/>
</mig:menu-info>
<mig:field-details>
<mig:fields existence="nonMap">
<mig:field>
<mig:field-type type="ons">
<mig:ui-field>funcCode</mig:ui-field>
<mig:label>FLT000204</mig:label>
<mig:label-desc>Function</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
</mig:field>
<mig:field>
<mig:field-type type="ux">
<mig:ui-field>submit</mig:ui-field>
<mig:label>FBT000000</mig:label>
<mig:section-structure></mig:section-structure>
<mig:form></mig:form>
</mig:field-type>
</mig:field>
<mig:field>
<mig:field-type type="ux">
<mig:ui-field>cancel</mig:ui-field>
<mig:label>FBT000001</mig:label>
<mig:section-structure></mig:section-structure>
<mig:form></mig:form>
</mig:field-type>
</mig:field>
</mig:fields>
<mig:fields existence="both">
<mig:field name="rptDfnMsg.rptDfnInfo.gprRptNum">
<mig:field-type type="ons">
<mig:control-type>Text Field</mig:control-type>
<mig:ui-field>rptNum</mig:ui-field>
<mig:label>FLT006718</mig:label>
<mig:label-desc>Report No.</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
<mig:field-type type="ux">
<mig:control-type>FinTextInputWithSearcher</mig:control-type>
<mig:ui-field>reportNo</mig:ui-field>
<mig:label>FLT005821</mig:label>
<mig:label-desc>Report No.</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
</mig:field>
<mig:field name="rptDfnMsg.rptDfnInfo.gprRptDesc">
<mig:field-type type="ons">
<mig:control-type>Desc. Label</mig:control-type>
<mig:ui-field>rptDesc</mig:ui-field>
<mig:label></mig:label>
<mig:mandatory>N</mig:mandatory>
</mig:field-type>
<mig:field-type type="ux">
<mig:control-type>FinTextInput</mig:control-type>
<mig:ui-field>desc</mig:ui-field>
<mig:label>FLT000690</mig:label>
<mig:label-desc>Description</mig:label-desc>
</mig:field-type>
</mig:field>
</mig:fields>
<mig:fields existence="ons">
<mig:field name="rptDfnMaster.gprRptDesc">
<mig:field-type type="ons">
<mig:ui-field>rptDesc</mig:ui-field>
<mig:label>FLT002771</mig:label>
<mig:label-desc>Description</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
</mig:field>
<mig:field name="rptDfnMaster.gprRptType.code">
<mig:field-type type="ons">
<mig:ui-field>rptType</mig:ui-field>
<mig:label>FLT007124</mig:label>
<mig:label-desc>Report Type</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
</mig:field>
</mig:fields>
<mig:fields existence="ux">
<mig:field name="rptDfnMsg.rptDfnInfo.gprRptType.code">
<mig:field-type type="ux">
<mig:ui-field>reporttype</mig:ui-field>
<mig:label>FLT005818</mig:label>
<mig:label-desc>Report Type</mig:label-desc>
<mig:mandatory>Y</mig:mandatory>
</mig:field-type>
</mig:field>
<mig:field name="rptDfnMsg.rptDfnInfo.gprRptConsolFlg">
<mig:field-type type="ux">
<mig:control-type>FinComboBox</mig:control-type>
<mig:ui-field>printRep</mig:ui-field>
<mig:label>FLT011541</mig:label>
</mig:field-type>
</mig:field>
</mig:fields>
</mig:field-details>
</mig:menu-compare>