fromXMLString returns appropriate object to remove the need to cast