The U.S. military says four American soldiers have died in separate attacks in Baghdad .