Extracts the complex notation string from the root node of the XHELM
document

@param rootElement root element
@return the complex notation string
425042
public static String getComplexNotationString(Element rootElement) {
    Element helmNotationElement = rootElement.getChild("HelmNotation");
    return helmNotationElement.getText();
  }
71783
@Deprecated
    private String extractElements(I_CmsXmlDocument xmlDoc) {

        StringBuffer result = new StringBuffer();
        if (xmlDoc instanceof CmsXmlPage) {
            List<?> locales = xmlDoc.getLocales();
            Iterator<?> i = locales.iterator();
            boolean firstIter = true;
            while (i.hasNext()) {
                if (!firstIter) {
                    result.append("\n\n-----");
                }
                Locale locale = (Locale)i.next();
                result.append("\n\n[").append(locale.toString()).append(']');
                List<?> elements = xmlDoc.getValues(locale);
                Iterator<?> j = elements.iterator();
                while (j.hasNext()) {
                    I_CmsXmlContentValue value = (I_CmsXmlContentValue)j.next();
                    result.append("\n\n[");
                    // output value of name attribute
                    result.append(value.getElement().attribute(0).getValue());
                    result.append("]\n\n");

                    I_CmsWidget widget = CmsWidgetUtil.collectWidgetInfo(value).getWidget();
                    result.append(
                        widget.getWidgetStringValue(
                            getCms(),
                            new CmsResourceInfoDialog(getJsp()),
                            (I_CmsWidgetParameter)value));

                }
                firstIter = false;
            }
        } else if (xmlDoc instanceof CmsXmlContent) {
            CmsXmlContentTextExtractor visitor = new CmsXmlContentTextExtractor(result);
            ((CmsXmlContent)xmlDoc).visitAllValuesWith(visitor);

        }
        return result.toString();
    }
249878
public String getNodeNameX(int nodeHandle)
  {

    /** @todo: implement this org.apache.xml.dtm.DTMDefaultBase abstract method */
    error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");

    return null;
  }
691058
def xml_to_root(xml: Union[str, IO]) -> ElementTree.Element:
    
    if isinstance(xml, str):
        if '<' in xml:
            return ElementTree.fromstring(xml)
        else:
            with open(xml) as fh:
                xml_to_root(fh)
    tree = ElementTree.parse(xml)
    return tree.getroot()
33849
static String getDeepName(final Element element) {
        if (element == null) {
            return "";
        }
        return getDeepName(element.getParentElement()) + '/' + element.getName();
    }
64561
@Override
	public String getObligation(String root)
	{
		StringBuilder result = new StringBuilder();
		String spacing = "  ";
		String indent = "";
		StringBuilder tail = new StringBuilder();

		for (IPOContext ctxt : this)
		{
			String po = ctxt.getContext();

			if (po.length() > 0)
			{
				result.append(indent);
				result.append("(");
				result.append(indentNewLines(po, indent));
				result.append("\n");
				indent = indent + spacing;
				tail.append(")");
			}
		}

		result.append(indent);
		result.append(indentNewLines(root, indent));
		result.append(tail);
		result.append("\n");

		return result.toString();
	}
749438
public static XdmNode getContextFromLog(
            net.sf.saxon.s9api.DocumentBuilder builder, Document log)
            throws Exception {
        Element starttest = (Element) log.getElementsByTagName("starttest")
                .item(0);
        NodeList nl = starttest.getElementsByTagName("context");
        if (nl == null || nl.getLength() == 0) {
            return null;
        } else {
            Element context = (Element) nl.item(0);
            Element value = (Element) context.getElementsByTagName("value")
                    .item(0);
            nl = value.getChildNodes();
            for (int i = 0; i < nl.getLength(); i++) {
                Node n = nl.item(i);
                if (n.getNodeType() == Node.ATTRIBUTE_NODE) {
                    String s = DomUtils.serializeNode(value);
                    XdmNode xn = builder.build(new StreamSource(
                            new CharArrayReader(s.toCharArray())));
                    return (XdmNode) xn.axisIterator(Axis.ATTRIBUTE).next();
                } else if (n.getNodeType() == Node.ELEMENT_NODE) {
                    Document doc = DomUtils.createDocument(n);
                    return builder.build(new DOMSource(doc));
                }
            }
        }
        return null;
    }
128082
private static String getTextContent(final Element element) {
		if (element != null) {
			String content = element.getTextContent();
			if (content != null) {
				content = content.trim();
			}
			return content;
		}
		return null;
	}
494904
public String getChildElementTextValue(Element parentElement, String elementName) {

        try {
            // get the first child element matching the specified name
            Element childElement = (Element)parentElement.selectNodes("./" + elementName).get(0);
            // return the value of the child element
            return childElement.getTextTrim();
        } catch (Exception e) {
            return null;
        }
    }
1005022
public XMLWriter startElement(String element) {
        append("<" + element);
        if (rootElement && xmlns != null) {
            append(" xmlns=\"" + xmlns + "\"");
            rootElement = false;
        }
        append(">");
        elementStack.push(element);
        return this;
    }
336290
public static String nodeToString(Node document) throws Exception {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        Source xmlSource = new DOMSource(document);
        Result outputTarget = new StreamResult(outputStream);
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.transform(xmlSource, outputTarget);

        return outputStream.toString();
    }
1043010
public String getPlainText(Element element) {
        FormattingVisitor formatter = new FormattingVisitor();
        NodeTraversor.traverse(formatter, element); // walk the DOM, and call .head() and .tail() for each node

        return formatter.toString();
    }
639553
private String getText(Element element) {
		try {
			for (int i = 0; i < element.getChildNodes().getLength(); i++) {
				Node node = element.getChildNodes().item(i);
				if (node.getNodeType() == Node.TEXT_NODE) {
					return node.getNodeValue();
				}
			}
		} catch (Exception e) {
		}
		return "";

	}
1042126
public static String toXml(Collection<?> root, String rootName, Class clazz) {
		return toXml(root, rootName, clazz, null);
	}
822735
static String getChildElementText(Element parent, String name) {
        // Get children
        List list = DomUtils.getChildElementsByName(parent, name);

        if (list.size() == 1) {
            Element child = (Element) list.get(0);

            StringBuffer buf = new StringBuffer();

            NodeList children = child.getChildNodes();
            for (int i = 0; i < children.getLength(); i++) {
                Node node = children.item(i);
                if (node.getNodeType() == Node.TEXT_NODE ||
                        node.getNodeType() == Node.CDATA_SECTION_NODE) {
                    Text text = (Text) node;
                    buf.append(text.getData().trim());
                }
            }

            return buf.toString();
        } else {
            return null;
        }
    }
657657
public static String convertXmlDocumentToString(DomDocument document) {
    StringWriter stringWriter = new StringWriter();
    StreamResult result = new StreamResult(stringWriter);
    transformDocumentToXml(document, result);
    return stringWriter.toString();
  }
509212
protected function createRootElement($rootElement)
    {
        if (is_string($rootElement)) {
            $rootElementName = $rootElement ?: 'root';

            return $this->document->createElement($rootElementName);
        }

        $rootElementName = $rootElement['rootElementName'] ?? 'root';

        $element = $this->document->createElement($rootElementName);

        foreach ($rootElement as $key => $value) {
            if ($key !== '_attributes' && $key !== '@attributes') {
                continue;
            }

            $this->addAttributes($element, $rootElement[$key]);
        }

        return $element;
    }