public static Element createElement(Node node, String name, String value, Map<String, Object> attributes) {
        Document doc = node.getNodeType() == Node.DOCUMENT_NODE ? (Document) node : node.getOwnerDocument();
        Element element = doc.createElement(name);
        element.setTextContent(value);
        addAttributes(element, attributes);
        return element;
    }
@Test
    void testCreateElement() {
        Node node = XmlUtils.createElement(getDocument(), "foo", "bar", null);
        String result = XmlUtils.toString(node);
        assertEquals(result, "<foo>bar</foo>");
    }