AttributesImpl attsOut = new AttributesImpl(); attsOut.clear(); attsOut.setAttribute(10000, "", "","ADWorkflowNameID", "", "test"); gives error: Attempt to modify attribute at illegal index: 10000 [junit] java.lang.ArrayIndexOutOfBoundsException: Attempt to modify attribute at illegal index: 10000 [junit] at org.xml.sax.helpers.AttributesImpl.badIndex(AttributesImpl.java:603) [junit] at org.xml.sax.helpers.AttributesImpl.setAttribute(AttributesImpl.java:423)