code: private static Element handleNode(Element parent, String xpathName) {
  
          // if node is no attribute, create a new node
          String childrenPart = null;
          String nodeName;
          int pos = xpathName.indexOf("[");
          if (pos > 0) {
              childrenPart = xpathName.substring(pos + 1, xpathName.length() - 1);
              nodeName = xpathName.substring(0, pos);
          } else {
              nodeName = xpathName;
          }
          // create node
          Element elem = parent.addElement(nodeName);
          if (childrenPart != null) {
              pos = childrenPart.indexOf("[");
              if ((pos > 0) && (childrenPart.indexOf("]") > pos)) {
                  handleNode(elem, childrenPart);
                  return elem;
              }
              if (childrenPart.contains("=")) {
                  Map<String, String> children = CmsStringUtil.splitAsMap(childrenPart, "][", "=");
                  // handle child nodes
                  for (Map.Entry<String, String> child : children.entrySet()) {
                      String childName = child.getKey();
                      String childValue = child.getValue();
                      if (childValue.startsWith("'")) {
                          childValue = childValue.substring(1);
                      }
                      if (childValue.endsWith("'")) {
                          childValue = childValue.substring(0, childValue.length() - 1);
                      }
                      if (childName.startsWith("@")) {
                          elem.addAttribute(childName.substring(1), childValue);
                      } else if (childName.equals("text()")) {
                          elem.setText(childValue);
                      } else if (!childName.contains("(")) {
                          Element childElem = elem.addElement(childName);
                          if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(childValue)) {
                              childElem.addText(childValue);
                          }
                      }
                  }
              }
          }
          return elem;
      }
docs: Handles the xpath name, by creating the given node and its children.<p>
  
  @param parent the parent node to use
  @param xpathName the xpathName, ie <code>a[@b='c'][d='e'][text()='f']</code>
  
  @return the new created element