Unix CLI tradition is to accept input from stdin if a filename argument is given as "-". So, I don't know that this works, but it's worth trying "echo $XMLDATA | xml format -". You might also try it with no filename argument at all: "echo $XMLDATA | xml format".
_________________________
Bitt Faulk