Java Utililty Methods XML Child Element Create

List of utility methods to do XML Child Element Create

Description

The list of methods to do XML Child Element Create are organized into topic(s).

Method

IIOMetadataNodegetOrCreateChildNode(IIOMetadataNode parentNode, String name)
Gets the named child node, or creates and attaches it.
NodeList nodeList = parentNode.getElementsByTagName(name);
if (nodeList != null && nodeList.getLength() > 0) {
    return (IIOMetadataNode) nodeList.item(0);
IIOMetadataNode childNode = new IIOMetadataNode(name);
parentNode.appendChild(childNode);
return childNode;
TextgetOrCreateFirstTextChild(Element node)
get Or Create First Text Child
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
    if (child instanceof Text) {
        return (Text) child;
Text result = node.getOwnerDocument().createTextNode("");
...
booleanhasActivityChildNodeWithCreateInstanceSet(Node node)
has Activity Child Node With Create Instance Set
boolean result = false;
for (Node child : getAllActivityChildNodesRecursively(node)) {
    if (isCreateInstanceSet(child))
        result = true;
return result;