Code example for Node

Methods: getAttributesgetNodeName

    public Map<String, String> getMetadataFromXML(String xmlSource) throws SerializerException {
        return getMetadata(xmlSource);
    private void renameAttrToTag(Document document, Node node) throws DOMException {
        if (node.getNodeName().equals("attr")) {
            String tag = node.getAttributes().getNamedItem("tag").getNodeValue();
            if (!tag.equals("?")) {
                document.renameNode(node, null, "tag" + tag);
    private void renameTagToAttr(Document document, Node node) throws DOMException {
        NamedNodeMap attr = node.getAttributes();
        if (attr != null) {
            Node tagAttr = attr.getNamedItem("tag");
Connect your IDE to all the code out there  Get Codota for Java