class XMLUtil {
    /**
     * Extracts the text from the given element.
     * {@link Node#getTextContent()} returns the text from ALL children, this returns the text only for this element.
     */
    public static String getTextContent(Node element) {<FILL_FUNCTION_BODY>}
}

        StringBuilder text = new StringBuilder();
        NodeList childNodes = element.getChildNodes();
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node child = childNodes.item(i);
            if (child instanceof Text) {
                text.append(child.getNodeValue());
            }
        }

        return text.toString();
    
<no_super_class>