Refactor: Promote _lookup_datastream_in_collection to priviledged.
Refactor: Promote node_get_child_element to priviledged.
Introduce new function: oscap_source_new_from_xmlDoc
Introduce: oval_results_model_export_source
Refactor: Rename function to oscap_xml_save_filename_free

To indicate that this function disposes the xmlNode afterwards.
Refactor: Extract function: oscap_xml_save_filename
Build xmlTextReader from the existing DOM.

This change will allow us to decrease ammount of open() calls
per file by 1 or by three in certain cases.
Do not pass NULL to strregcomp

xmlWalkerReader may give us NULL where we used to get "" from
xmlTextReader

Addressing:
 #1  0x00007ffff7d5cd3b in strregcomp (pattern=0x629a70 ".*", test_str=0x0)
	at oval_cmp_basic.c:143
 #2  0x00007ffff7d5cecf in oval_string_cmp (state=0x629a70 ".*", syschar=0x0,
	operation=OVAL_OPERATION_PATTERN_MATCH) at oval_cmp_basic.c:192
 #3  0x00007ffff7d5c362 in oval_ent_cmp_str (state_data=0x629a70 ".*",
	state_data_type=OVAL_DATATYPE_STRING, sysent=0x62a210,
	operation=OVAL_OPERATION_PATTERN_MATCH) at oval_cmp.c:99
 #4  0x00007ffff7d64a44 in _evaluate_sysent (syschar_model=0x61c870,
	item_entity=0x62a210, state_entity=0x6299c0,
	state_entity_operation=OVAL_OPERATION_PATTERN_MATCH,
	content=0x629970) at oval_resultTest.c:464
 #5  0x00007ffff7d64cd5 in eval_item (syschar_model=0x61c870,
	cur_sysitem=0x61f200, state=0x61fab0) at oval_resultTest.c:546
 #6  0x00007ffff7d65021 in eval_check_state (test=0x627d60,
	args=0x7fffffffd600) at oval_resultTest.c:644
 #7  0x00007ffff7d6553a in _oval_result_test_evaluate_items
	(test=0x627d60, syschar_object=0x61e180, args=0x7fffffffd600)
	at oval_resultTest.c:805
 #8  0x00007ffff7d65765 in _oval_result_test_result (rtest=0x62a770,
	args=0x7fffffffd600) at oval_resultTest.c:870
 #9  0x00007ffff7d65af4 in oval_result_test_eval (rtest=0x62a770) at
	oval_resultTest.c:966
 #10 0x00007ffff7d5f907 in _oval_result_criteria_node_result
	(node=0x62d510) at oval_resultCriteriaNode.c:357
 #11 0x00007ffff7d5f99f in oval_result_criteria_node_eval (node=0x62d510)
	at oval_resultCriteriaNode.c:378
 #12 0x00007ffff7d5f8a5 in _oval_result_criteria_node_result
	(node=0x61e1e0) at oval_resultCriteriaNode.c:348
Do not report the same error multiple times

Addressing output like:
test_unfinished.xccdf.xml:18: parser error : Premature end of data in
tag Benchmark line 2

^
Could not dermine document type
OpenSCAP Error: Unable to parse XML at: 'test_unfinished.xccdf.xml' (No
such file or directory) [oscap_source.c:161]
Unable to open file: 'test_unfinished.xccdf.xml' (No such file or
directory) [oscap_source.c:145]
Do not report errno when xmlError is encountered

It is not terribly useful.

Addressing output like:
test_unfinished.xccdf.xml:18: parser error : Premature end of data in
tag Benchmark line 2

^
Could not dermine document type
OpenSCAP Error: Unable to parse XML at: 'test_unfinished.xccdf.xml' (Do
not report errno when xmlError is encountered

It is not terribly usefull ) [oscap_source.c:161]
tests: Expect different output after xmlTextReader changes.
Refactor: Extract function: oval_determine_document_schema_version_priv.
Do not try to open file again to determine oval version

Reuse existing DOM instead.
Avoid using xmlTextReaderReadString function.

It requires that we have correct position on the TextNode.
Interestingly, there were no problems with native xmlTextReader,
but with xmlWalkerReader we are hitting xmllib2 TODO like:

   Unimplemented block at xmlreader.c:1794
OVAL Results export should use oscap_source_save_as.
Use oscap_source within _xccdf_session_export_oval_result_file
Move oval_results_model_export_source to public API.
Refactor: Extract function: lookup_xsi_ns.
Do not export namespaced property by xmlNewPror

Use xmlNewNsProp instead.

Addressing (pre-export validation error):
OpenSCAP Error: File '/tmp/oscap.HceiZV/stub-oval.xml.result.xml' line 0:
	Element '{http://oval.mitre.org/XMLSchema/oval-results-5}oval_results',
	attribute 'xsi:schemaLocation': The attribute 'xsi:schemaLocation' is not allowed.
		[xccdf_session.c:346]
Could not export OVAL Results correctly to /tmp/oscap.HceiZV/stub-oval.xml.result.xml [xccdf_session.c:1202]
Drop OVAL_XMLNS_XSI.