fdo#75397: Write unit test for this.

Change-Id: Id261aebd427eb032463668c2654ce837139b4a05
fdo#75397: Return an empty string for empty element.

This is the behavior as of 3.6.  It had changed in 4.0 and onward by
accident, and caused the bug as reported in fdo#75397.

Change-Id: Id96fea354604b3c13cbbf2d9a73223b7725c7d66