try {
Element pointsName = document.createElement("points");
baseElement.appendChild(pointsName);
LinkedHashMap pointsMap = (LinkedHashMap) paint.get(1);
for (Iterator it = pointsMap.keySet().iterator();it.hasNext();){
Integer key = (Integer) it.next();
LinkedHashMap point = (LinkedHashMap) pointsMap.get(key);
Element pointElement = document.createElement(point.get(0).toString());
pointElement.setAttribute("val1", point.get(1).toString());
pointElement.setAttribute("val2", point.get(2).toString());