curl https://lccn.loc.gov/sh2018002914/marcxml -o sh2018002914.xml
Working from a simple list:
for lccn in nb2015017302 sh2018002914 n89223874; do curl https://lccn.loc.gov/$lccn/marcxml -o $lccn.xml; sleep 1; done
Separate the lccns with a single space. Added a second of sleep to avoid getting shut out.
If it gets longer, consider making a full bash script, as below:
#!/bin/bash
for lccn in nb2015017302 sh2018002914 n89223874 n82203435 sh85033801
do
curl https://lccn.loc.gov/$lccn/marcxml -o $lccn.xml
sleep 1
done