code: public static Text toText(Document doc, Object o) throws PageException {
  	if (o instanceof Text) return (Text) o;
  	else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
  	return doc.createTextNode(Caster.toString(o));
      }
docs: casts a value to a XML Text
  
  @param doc XML Document
  @param o Object to cast
  @return XML Text Object
  @throws PageException