http://qs321.pair.com?node_id=795534


in reply to extract ids

What about this?
perl -lne 'print for /molecule_idref="([^"]+)/g' xmlfile

I've used 'g' modifier to catch ids in a case they occur more than one on a line.