Currently --print-xid option prints the value without the ending new-line. It leads to inconvenience when using a pipe for some scripting (because of the need to use unbuffered reads).
For example, consider a test case (surely run with bash shell):
yad --text=foobar --print-xid=>(read str; echo $str)
The proposed patch attached.
I believe the extra new-line should not spoil anything, since it is either omitted by scripting languages or eaten by sscanf() etc. in binaries.