Here you can find the source of attrbiuteToMap( NamedNodeMap attributes)
private static Map<String, String> attrbiuteToMap( NamedNodeMap attributes)
//package com.java2s; //License from project: Apache License import java.util.LinkedHashMap; import java.util.Map; import org.w3c.dom.NamedNodeMap; public class Main { private static Map<String, String> attrbiuteToMap( NamedNodeMap attributes) { if (attributes == null) return new LinkedHashMap<String, String>(); Map<String, String> result = new LinkedHashMap<String, String>(); for (int i = 0; i < attributes.getLength(); i++) { result.put(attributes.item(i).getNodeName(), attributes.item(i) .getNodeValue());//from w w w.java 2 s. com } return result; } }