public static Node toNode(Document doc, Object o, short type) throws PageException {

	if (Node.TEXT_NODE == type) toText(doc, o);
	else if (Node.ATTRIBUTE_NODE == type) toAttr(doc, o);
	else if (Node.COMMENT_NODE == type) toComment(doc, o);
	else if (Node.ELEMENT_NODE == type) toElement(doc, o);

	throw new ExpressionException("invalid node type definition");
    }
public static Node toNode ( Document doc , Object o , short type ) throws PageException { if ( Node . TEXT_NODE == type ) toText ( doc , o ) ; else if ( Node . ATTRIBUTE_NODE == type ) toAttr ( doc , o ) ; else if ( Node . COMMENT_NODE == type ) toComment ( doc , o ) ; else if ( Node . ELEMENT_NODE == type ) toElement ( doc , o ) ; throw new ExpressionException ( "invalid node type definition" ) ; }
casts a value to a XML Object defined by type parameter

@param doc XML Document
@param o Object to cast
@param type type to cast to
@return XML Text Object
@throws PageException