for(int i=0;i<attrNSList.size();i++){
AttributeNS attrNs = (AttributeNS)attrNSList.get(i);
xsw.writeNamespace(attrNs.getPrefix(),attrNs.getUri());
}
for(int i=0;i<attrList.size();i++){
StAXAttr attr = (StAXAttr) attrList.get(i);
if(parentNS.containsKey(attr.getPrefix())){
xsw.writeNamespace(attr.getPrefix(),parentNS.get(attr.getPrefix()));
}
}
for(int i=0;i<attrList.size();i++){
StAXAttr attr = (StAXAttr) attrList.get(i);
xsw.writeAttribute(attr.getPrefix(),attr.getUri(),attr.getLocalName(),attr.getValue());
}
}