title: Format all XML files in a directory and save them in a subdirectory
body: <p>I'm trying to write a script that will look through a directory, find all the XML files, run them through <code>xmllint</code>, and save the formatted results to a file of the same name in a subdirectory called <code>formatted</code>. Here's the script I have so far:</p>
  
  <pre><code>find . -maxdepth 1 -type f -iname "*.xml" | xargs -I '{}' xmllint --format '{}' &gt; formatted/'{}'
  </code></pre>
  
  <p>This works, to an extent. The subdirectory ends up with one file, named <code>"{}"</code>, which is just the results of the final file that was processed through <code>xmllint</code>. How can I get the files to write properly to the subdirectory?</p>