Read begin tag, text, end tag.

@param name

@return The trimmed text content or null.
173266
private String getElementText(Element element) {
        Node node = element.getFirstChild();
        if (node == null || node.getNodeType() != Node.TEXT_NODE) {
            return null;
        }
        return node.getNodeValue().trim();
    }
362772
public String readSnippet(String name) {

        String path = CmsStringUtil.joinPaths(
            m_ui.getUpdateBean().getWebAppRfsPath(),
            CmsUpdateBean.FOLDER_UPDATE,
            "html",
            name);
        try (InputStream stream = new FileInputStream(path)) {
            byte[] data = CmsFileUtil.readFully(stream, false);
            String result = new String(data, "UTF-8");
            return result;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
356502
public <T extends Tag> T get(String tagName) {
        return (T) this.value.get(tagName);
    }
37067
public Taglet getTaglet(String name) {
        if (name.indexOf("@") == 0) {
            return customTags.get(name.substring(1));
        } else {
            return customTags.get(name);
        }

    }
982537
public String getSeleniumScript(String name) {
    String rawFunction = readScript(PREFIX + name);

    return String.format("function() { return (%s).apply(null, arguments);}",
                         rawFunction);
  }
274953
private Element getChildElement(String name) {
        if (currentChild == null) {
            // element has no children.
            return null;
        }
        Node start = currentChild;
        do {
            Node node = currentChild;
            currentChild = currentChild.getNextSibling();
            if (currentChild == null) {
                currentChild = currentElement.getFirstChild();
            }
            if (node.getNodeType() == Node.ELEMENT_NODE
                    && node.getNodeName().equals(name)) {
                return (Element) node;
            }
        } while (currentChild != start);
        return null;
    }
73575
private String getNamedTagText(final Element element, final String tagName) {
		Element foundElement = XmlElementUtil.getFirstElementByTagName(element, tagName);
		if (foundElement == null) {
			return "";
		} else {
			return foundElement.getTextContent();
		}
	}
274972
public void writeElement(String name, Object text)
  {
    startElement(name);
    writeText(text);
    endElement(name);
  }
554392
protected Iterable<String> readtext(String name, boolean unescapeNewlines) throws IOException {
    ArrayList<String> res = new ArrayList<>(50);
    BufferedReader br = _reader.getTextFile(name);
    try {
      String line;
      while (true) {
        line = br.readLine();
        if (line == null) break;
        if (unescapeNewlines)
          line = StringEscapeUtils.unescapeNewlines(line);
        res.add(line.trim());
      }
      br.close();
    } finally {
      try { br.close(); } catch (IOException e) { /* ignored */ }
    }
    return res;
  }
597645
public XmlStringBuilder element(String name, String content) {
        if (content.isEmpty()) {
            return emptyElement(name);
        }
        openElement(name);
        escape(content);
        closeElement(name);
        return this;
    }
306300
public Label getNamedBreakLabel(String name) {
        Label label = getBreakLabel();
        Label endLabel = null;
        if (name!=null) endLabel = (Label) namedLoopBreakLabel.get(name);
        if (endLabel!=null) label = endLabel;
        return label;
    }
48731
public static Element getChild(Element element, String name) {
        return (Element) element.getElementsByTagName(name).item(0);
    }
147422
public void writeLineElement(String name, Object text)
  {
    startLineElement(name);
    writeText(text);
    endLineElement(name);
  }
81210
public static Reader getReader(String name) {
		InputStream inputStream = getInputStream(name);
		if (inputStream != null) {
			BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
			return reader;
		}
		return null;
	}
1189875
public void endElement(String name) throws org.xml.sax.SAXException
    {
        endElement(null, null, name);
    }
1167881
public T get(String name) {		
		String lcName = name.toLowerCase();
		for (T item : collection) {
			if (item.getName().toLowerCase().equals(lcName)) {
				return item;
			}
		}

		return null;
	}
86201
private void readTag() throws XMLException, IOException {
		try {
			char c;
			if ((c = stream.read()) == '!') {
				readTagExclamation();
			} else if (c == '?') {
				readProcessingInstruction();
			} else if (c == '/') {
				readEndTag();
			} else if (isNameStartChar(c)) {
				readStartTag(c);
			} else {
				throw new XMLException(getPosition(), "Unexpected character", Character.valueOf(c));
			}
		} catch (EOFException e) {
			throw new XMLException(getPosition(), new LocalizableString("lc.xml.error", "Unexpected end"),
					new LocalizableString("lc.xml.error", "in XML document"));
		}
	}