code: public static Node[] toNodeArray(Document doc, Object o, short type) throws PageException {
  
  	if (Node.TEXT_NODE == type) toTextArray(doc, o);
  	else if (Node.ATTRIBUTE_NODE == type) toAttrArray(doc, o);
  	else if (Node.COMMENT_NODE == type) toCommentArray(doc, o);
  	else if (Node.ELEMENT_NODE == type) toElementArray(doc, o);
  
  	throw new ExpressionException("invalid node type definition");
      }
docs: casts a value to a XML Object Array defined by type parameter
  
  @param doc XML Document
  @param o Object to cast
  @param type type to cast to
  @return XML Node Array Object
  @throws PageException