Why does the following gives the line I am searching:
grep '<appointment-id internal:ref=1.2.3/>' test.xml  
OUTPUT is <appointment-id internal:ref=1.2.3/>  
While the following breaks it into 2 lines?
a=($(grep '<appointment-id internal:ref=1.2.3/>' test.xml))  
for i in "${a[@]}"; do  
    echo "checking $i"   
    grep  -n "$i" delete.xml
done    
The output is:
checking <appointment-id
checking internal:ref=1.2.3/>
The file is:
<note>  
    <to>Jim</to>  
    <from>John</from>  
    <heading>Reminder</heading>  
    <body>Some text</body>  
    <appointment-id internal:ref=1.2.3/> 
</note>
    
IFS=$' \t\n'. see What is the 'IFS'?a+=("$line")).