Alberto Gonzales has been formally sworn in as U.S. attorney general , saying he welcomes the opportunity to serve as the country 's top law enforcement official .