That's a nice program, but too bad you decrease its usefulness and adaptability by making it a standalone replacement for mdfind instead of something that you can pipe mdfind into. Why not follow the flexibility and power of the command line tradition by making your program usable like this:
mdfind "search terms" | mdxml > found_items.xml

Assuming you would then change the name of your program to mdxml.

You don't have to worry about making and maintaining an interface to mdfind functionality, and users can do so much more with your tool.