Extracting text nodes and nulls from XML elements