Regarding shuffling/randomizing them, this would be more of a Flash issue...not an XML issue, unless you're working with the XML itself without using any Flash libraries to manipulate the XML. In the case of working with the XML itself, I know of no such way to do this.
As for selecting the number of questions before doing the test, you might be better off using something like QUESTION rather than Q2, Q3, Q4, etc. and limiting the number of questions using XPath (e.g. position() < 20 for less than 20 questions) if that is available unless I'm missing something.