Use a yaml/json/xml file to drive ansible?

Is there a way to use a yaml/json/xml or other similar config file to drive ansible playbooks?

That is, sucking a DOM like object and walking it (not knowing exactly what to look for… i.e., not simply an XPATH type parsing).