Although I don't angree with the choice of words (I think xargs is very real and a very handy tool, but that's a very personal opinion
), I can relate to the 'not so beautifull'.
You don't specify why the first part of the pipe cannot be started/read from within the script, any particular reason??
If incorporating the first part into the shellscript isn't possible, then you have to use C or Perl.