I have this parameters to download a XML file:
wget --http-user=user --http-password=pass http://www.example.com/file.xml
How I have to use
Shellwrap is great tool for using the command-line in PHP!
Your example can be done quite easy and readable:
use MrRio\ShellWrap as sh; $xml = (string)sh::curl(['u' => 'user:pass'], 'http://example.com/file.xml');