public void Text(String text) throws Exception { String result = ""; if (this._NodeType == null) { throw new Exception("Must set NodeType before setting Text."); } String type = this._NodeType.toString(); if (type.equals("text") || type.equals("attribute")) { this.NodeValue(text); } else { DOMNode child = new DOMNode(); child._NodeType = new DOMNodeType("text"); child.Text(text); this.AppendChild(child); } }