diff --git a/CMake/PackageDepends/MITK_tinyxml2_Config.cmake b/CMake/PackageDepends/MITK_tinyxml2_Config.cmake
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/CMake/PackageDepends/MITK_tinyxml_Config.cmake b/CMake/PackageDepends/MITK_tinyxml_Config.cmake
deleted file mode 100644
index ee84a8ae1a..0000000000
--- a/CMake/PackageDepends/MITK_tinyxml_Config.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-list(APPEND ALL_LIBRARIES ${tinyxml_LIBRARIES})
-if(tinyxml_INCLUDE_DIRS)
-  list(APPEND ALL_INCLUDE_DIRECTORIES ${tinyxml_INCLUDE_DIRS})
-endif()
diff --git a/CMakeExternals/ExternalProjectList.cmake b/CMakeExternals/ExternalProjectList.cmake
index ab452fc867..6305e62d20 100644
--- a/CMakeExternals/ExternalProjectList.cmake
+++ b/CMakeExternals/ExternalProjectList.cmake
@@ -1,26 +1,26 @@
 mitkFunctionAddExternalProject(NAME Poco ON COMPONENTS Foundation Net Util XML Zip)
 mitkFunctionAddExternalProject(NAME DCMTK ON DOC "EXPERIMENTAL, superbuild only: Use DCMTK in MITK")
 mitkFunctionAddExternalProject(NAME OpenIGTLink OFF)
-mitkFunctionAddExternalProject(NAME tinyxml ON ADVANCED)
+mitkFunctionAddExternalProject(NAME tinyxml2 ON ADVANCED)
 mitkFunctionAddExternalProject(NAME GDCM ON ADVANCED)
 mitkFunctionAddExternalProject(NAME Eigen ON ADVANCED DOC "Use the Eigen library")
 mitkFunctionAddExternalProject(NAME ANN ON ADVANCED DOC "Use Approximate Nearest Neighbor Library")
 mitkFunctionAddExternalProject(NAME CppUnit ON ADVANCED DOC "Use CppUnit for unit tests")
 mitkFunctionAddExternalProject(NAME PCRE OFF ADVANCED NO_PACKAGE)
 mitkFunctionAddExternalProject(NAME HDF5 ON ADVANCED)
 mitkFunctionAddExternalProject(NAME SWIG OFF ADVANCED NO_PACKAGE DEPENDS PCRE)
 mitkFunctionAddExternalProject(NAME OpenCV OFF)
 mitkFunctionAddExternalProject(NAME Vigra OFF DEPENDS HDF5)
 mitkFunctionAddExternalProject(NAME ITK ON NO_CACHE DEPENDS HDF5)
 mitkFunctionAddExternalProject(NAME VTK ON NO_CACHE)
 mitkFunctionAddExternalProject(NAME Boost ON NO_CACHE)
 mitkFunctionAddExternalProject(NAME ZLIB OFF ADVANCED)
 mitkFunctionAddExternalProject(NAME cpprestsdk OFF DEPENDS Boost ZLIB ADVANCED)
 mitkFunctionAddExternalProject(NAME OpenMesh OFF)
 mitkFunctionAddExternalProject(NAME CTK ON DEPENDS Qt5 DCMTK DOC "Use CTK in MITK")
 mitkFunctionAddExternalProject(NAME DCMQI ON DEPENDS DCMTK ITK DOC "Use dcmqi in MITK")
 mitkFunctionAddExternalProject(NAME MatchPoint OFF ADVANCED DEPENDS ITK DOC "Use the MatchPoint translation image registration library")
 
 if(MITK_USE_Qt5)
  mitkFunctionAddExternalProject(NAME Qwt ON ADVANCED DEPENDS Qt5)
 endif()
diff --git a/CMakeExternals/tinyxml-2.6.2.patch b/CMakeExternals/tinyxml-2.6.2.patch
deleted file mode 100644
index 4a601bb1e5..0000000000
--- a/CMakeExternals/tinyxml-2.6.2.patch
+++ /dev/null
@@ -1,266 +0,0 @@
-diff -burN tinyxml/tinyxml.cpp tinyxml-src/tinyxml.cpp
---- tinyxml/tinyxml.cpp	2011-05-15 04:24:57.000000000 +0200
-+++ tinyxml-src/tinyxml.cpp	2015-01-14 15:19:38.685333149 +0100
-@@ -34,6 +34,9 @@
- FILE* TiXmlFOpen( const char* filename, const char* mode );
- 
- bool TiXmlBase::condenseWhiteSpace = true;
-+static unsigned int required_decimal_places = 14+1; // Need 14 for mitk default accuracy plus 1 to make sure we're within tolerance.
-+
-+
- 
- // Microsoft compiler security
- FILE* TiXmlFOpen( const char* filename, const char* mode )
-@@ -757,21 +760,21 @@
- #endif
- 
- 
--void TiXmlElement::SetDoubleAttribute( const char * name, double val )
-+void TiXmlElement::SetDoubleAttribute( const char * name, double val, const unsigned int requiredDecimalPlaces )
- {	
- 	TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
- 	if ( attrib ) {
--		attrib->SetDoubleValue( val );
-+    attrib->SetDoubleValue( val, requiredDecimalPlaces );
- 	}
- }
- 
- 
- #ifdef TIXML_USE_STL
--void TiXmlElement::SetDoubleAttribute( const std::string& name, double val )
-+void TiXmlElement::SetDoubleAttribute( const std::string& name, double val, const unsigned int requiredDecimalPlaces )
- {	
- 	TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
- 	if ( attrib ) {
--		attrib->SetDoubleValue( val );
-+    attrib->SetDoubleValue( val, requiredDecimalPlaces );
- 	}
- }
- #endif 
-@@ -1242,33 +1245,73 @@
- 
- int TiXmlAttribute::QueryDoubleValue( double* dval ) const
- {
-+  //save old locale
-+  char * oldLocale;
-+  oldLocale = setlocale( LC_ALL, 0 );
-+
-+  //set new locale
-+  setlocale( LC_ALL, "C" );
- 	if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 )
-+  {
-+    //restore locale
-+    setlocale( LC_ALL, oldLocale );
- 		return TIXML_SUCCESS;
-+  }
-+  //restore locale
-+  setlocale( LC_ALL, oldLocale );
- 	return TIXML_WRONG_TYPE;
- }
- 
- void TiXmlAttribute::SetIntValue( int _value )
- {
- 	char buf [64];
--	#if defined(TIXML_SNPRINTF)		
-+#if defined(TIXML_SNPRINTF)
- 		TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value);
--	#else
-+#else
- 		sprintf (buf, "%d", _value);
--	#endif
-+#endif
- 	SetValue (buf);
- }
- 
--void TiXmlAttribute::SetDoubleValue( double _value )
-+
-+
-+
-+void TiXmlAttribute::SetDoubleValue( double _value, const unsigned int requiredDecimalPlaces )
- {
-+#if defined(TIXML_USE_STL)
-+  std::ostringstream ss;
-+  //save old locale
-+  char * oldLocale;
-+  oldLocale = setlocale( LC_ALL, 0 );
-+
-+  //set new locale
-+  setlocale( LC_ALL, "C" );
-+  ss.precision(TiXmlBase::Precision(_value, requiredDecimalPlaces));
-+  ss << _value;
-+  SetValue( ss.str() );
-+  //restore locale
-+  setlocale( LC_ALL, oldLocale );
-+#else
- 	char buf [256];
--	#if defined(TIXML_SNPRINTF)		
--		TIXML_SNPRINTF( buf, sizeof(buf), "%g", _value);
--	#else
--		sprintf (buf, "%g", _value);
--	#endif
-+
-+  //save old locale
-+  char * oldLocale;
-+  oldLocale = setlocale( LC_ALL, 0 );
-+
-+  //set new locale
-+  setlocale( LC_ALL, "C" );
-+#if defined(TIXML_SNPRINTF)
-+  TIXML_SNPRINTF( buf, sizeof(buf), TiXmlBase::Format(_value, requiredDecimalPlaces).c_str(), _value);
-+#else
-+  sprintf (buf, TiXmlBase::Format(_value, requiredDecimalPlaces).c_str(), _value);
-+#endif
- 	SetValue (buf);
-+  //restore locale
-+  setlocale( LC_ALL, oldLocale );
-+#endif
- }
- 
-+
- int TiXmlAttribute::IntValue() const
- {
- 	return atoi (value.c_str ());
-@@ -1276,7 +1319,15 @@
- 
- double  TiXmlAttribute::DoubleValue() const
- {
-+#if defined(TIXML_USE_STL)
-+  std::istringstream ss(value);
-+  ss.imbue(std::locale("C"));
-+  double dval;
-+  ss >> dval;
-+  return dval;
-+#else
- 	return atof (value.c_str ());
-+#endif
- }
- 
- 
-@@ -1884,3 +1935,36 @@
- 	return true;
- }
- 
-+unsigned int TiXmlBase::Precision( const double value, const unsigned int requiredDecimalPlaces ) const
-+{
-+  unsigned int lhs = 0;
-+  unsigned int one_for_plus_minus_sign = 1;
-+
-+  lhs = 0;
-+  double temp(value);
-+  while (temp >= 1.0)
-+  {
-+    lhs++;
-+    temp /= 10.0;
-+  }
-+
-+  return( lhs + requiredDecimalPlaces + one_for_plus_minus_sign );
-+}
-+
-+/**
-+    Return the printf format string that will ensure that the double value
-+    passed in will be stored with 'required_decimal_places' worth of decimal
-+    points as well as enough digits for the left hand side of the decimal point.
-+ */
-+TIXML_STRING TiXmlBase::Format( const double value, const unsigned int requiredDecimalPlaces ) const
-+{
-+  char buf[ 32 ];
-+
-+#if defined(TIXML_SNPRINTF)
-+  TIXML_SNPRINTF( buf, sizeof(buf), "%%%d.%dlf", Precision(value, requiredDecimalPlaces), requiredDecimalPlaces);
-+#else
-+  sprintf( buf, "%%%d.%dlf", Precision(value, requiredDecimalPlaces), requiredDecimalPlaces);
-+#endif
-+
-+  return(TIXML_STRING(buf));
-+}
-diff -burN tinyxml/tinyxml.h tinyxml-src/tinyxml.h
---- tinyxml/tinyxml.h	2011-05-15 04:24:57.000000000 +0200
-+++ tinyxml-src/tinyxml.h	2015-01-14 15:19:38.686333149 +0100
-@@ -20,12 +20,24 @@
- 
- 3. This notice may not be removed or altered from any source
- distribution.
--*/
-+ */
- 
- 
- #ifndef TINYXML_INCLUDED
- #define TINYXML_INCLUDED
- 
-+#ifndef TIXML_USE_STL
-+  #define TIXML_USE_STL
-+#endif
-+
-+#ifndef TIXML_USE_STL
-+#define TIXML_USE_STL
-+#endif
-+
-+#ifndef TIXML_USE_STL
-+#define TIXML_USE_STL
-+#endif
-+
- #ifdef _MSC_VER
- #pragma warning( push )
- #pragma warning( disable : 4530 )
-@@ -93,9 +105,11 @@
- const int TIXML_MINOR_VERSION = 6;
- const int TIXML_PATCH_VERSION = 2;
- 
-+#define DEFAULT_REQUIRED_DECIMAL_PLACES 14
-+
- /*	Internal structure for tracking location of items 
- 	in the XML file.
--*/
-+ */
- struct TiXmlCursor
- {
- 	TiXmlCursor()		{ Clear(); }
-@@ -283,6 +297,10 @@
- 		TIXML_ERROR_STRING_COUNT
- 	};
- 
-+  unsigned int Precision( const double value, const unsigned int requiredDecimalPlaces ) const ;
-+
-+  TIXML_STRING Format( const double value, const unsigned int requiredDecimalPlaces ) const;
-+
- protected:
- 
- 	static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
-@@ -836,14 +854,14 @@
- 	void SetValue( const char* _value )	{ value = _value; }				///< Set the value.
- 
- 	void SetIntValue( int _value );										///< Set the value from an integer.
--	void SetDoubleValue( double _value );								///< Set the value from a double.
-+  void SetDoubleValue( double _value, const unsigned int requiredDecimalPlaces = DEFAULT_REQUIRED_DECIMAL_PLACES );        ///< Set the value from a double.
- 
--    #ifdef TIXML_USE_STL
-+#ifdef TIXML_USE_STL
- 	/// STL std::string form.
- 	void SetName( const std::string& _name )	{ name = _name; }	
- 	/// STL std::string form.	
- 	void SetValue( const std::string& _value )	{ value = _value; }
--	#endif
-+#endif
- 
- 	/// Get the next sibling attribute in the DOM. Returns null at end.
- 	const TiXmlAttribute* Next() const;
-@@ -1061,8 +1079,8 @@
- 	///< STL std::string form.
- 	void SetAttribute( const std::string& name, int _value );
- 	///< STL std::string form.
--	void SetDoubleAttribute( const std::string& name, double value );
--	#endif
-+  void SetDoubleAttribute( const std::string& name, double value, const unsigned int requiredDecimalPlaces = DEFAULT_REQUIRED_DECIMAL_PLACES );
-+#endif
- 
- 	/** Sets an attribute of name to a given value. The attribute
- 		will be created if it does not exist, or changed if it does.
-@@ -1072,7 +1090,7 @@
- 	/** Sets an attribute of name to a given value. The attribute
- 		will be created if it does not exist, or changed if it does.
- 	*/
--	void SetDoubleAttribute( const char * name, double value );
-+  void SetDoubleAttribute( const char * name, double value, const unsigned int requiredDecimalPlaces = DEFAULT_REQUIRED_DECIMAL_PLACES );
- 
- 	/** Deletes an attribute with the given name.
- 	*/
diff --git a/CMakeExternals/tinyxml.cmake b/CMakeExternals/tinyxml2.cmake
similarity index 65%
rename from CMakeExternals/tinyxml.cmake
rename to CMakeExternals/tinyxml2.cmake
index 74391bee27..8b24f8c184 100644
--- a/CMakeExternals/tinyxml.cmake
+++ b/CMakeExternals/tinyxml2.cmake
@@ -1,52 +1,52 @@
 #-----------------------------------------------------------------------------
-# tinyxml
+# tinyxml2
 #-----------------------------------------------------------------------------
 
 # Sanity checks
-if(DEFINED tinyxml_DIR AND NOT EXISTS ${tinyxml_DIR})
-  message(FATAL_ERROR "tinyxml_DIR variable is defined but corresponds to non-existing directory")
+if(DEFINED tinyxml2_DIR AND NOT EXISTS ${tinyxml2_DIR})
+  message(FATAL_ERROR "tinyxml2_DIR variable is defined but corresponds to non-existing directory")
 endif()
 
-set(proj tinyxml)
+set(proj tinyxml2)
 set(proj_DEPENDENCIES )
 set(${proj}_DEPENDS ${proj})
 
-if(NOT DEFINED tinyxml_DIR)
+if(NOT DEFINED tinyxml2_DIR)
 
   set(additional_cmake_args )
   if(WIN32)
     set(additional_cmake_args -DBUILD_SHARED_LIBS:BOOL=OFF)
   endif()
 
   if(CTEST_USE_LAUNCHERS)
     list(APPEND additional_cmake_args
       "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
     )
   endif()
 
   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/tinyxml_2_6_2.tar.gz
-     URL_MD5 c1b864c96804a10526540c664ade67f0
-     PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/tinyxml-2.6.2.patch
-       COMMAND ${CMAKE_COMMAND} -Dproj=${proj} -Dproj_target:STRING=tinyxml -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake
+     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/tinyxml2-8.0.0.tar.gz
+     URL_MD5 5dc535c8b34ee621fe2128f072d275b5
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS
        ${ep_common_args}
        ${additional_cmake_args}
      CMAKE_CACHE_ARGS
        ${ep_common_cache_args}
+       -DBUILD_TESTING:BOOL=OFF
+       -DBUILD_TESTS:BOOL=OFF
      CMAKE_CACHE_DEFAULT_ARGS
        ${ep_common_cache_default_args}
      DEPENDS ${proj_DEPENDENCIES}
     )
 
   set(${proj}_DIR ${ep_prefix})
   mitkFunctionInstallExternalCMakeProject(${proj})
 
 else()
 
   mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
 
 endif()
diff --git a/CMakeExternals/tinyxmlCMakeLists.txt b/CMakeExternals/tinyxmlCMakeLists.txt
deleted file mode 100644
index d19c0dfb25..0000000000
--- a/CMakeExternals/tinyxmlCMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-cmake_minimum_required(VERSION 2.8.4)
-
-project(tinyxml)
-
-set(${PROJECT_NAME}_MAJOR_VERSION 2)
-set(${PROJECT_NAME}_MINOR_VERSION 6)
-set(${PROJECT_NAME}_PATCH_VERSION 2)
-set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
-
-
-set(tinyxml_HEADERS
-  tinystr.h
-  tinyxml.h
-)
-
-set(tinyxml_SOURCES
-  tinyxml.cpp
-  tinyxmlparser.cpp
-  tinyxmlerror.cpp
-  tinystr.cpp
-)
-
-add_library(tinyxml ${tinyxml_HEADERS} ${tinyxml_SOURCES})
-set_target_properties(tinyxml PROPERTIES
-                      SOVERSION ${${PROJECT_NAME}_VERSION})
-
-set(${PROJECT_NAME}_LIBRARIES tinyxml)
-
-# Install support
-
-install(TARGETS ${${PROJECT_NAME}_LIBRARIES} EXPORT ${PROJECT_NAME}_TARGETS
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib
-  RUNTIME DESTINATION bin
-  INCLUDES DESTINATION include/${PROJECT_NAME}
-)
-install(FILES ${tinyxml_HEADERS}
-  DESTINATION include/${PROJECT_NAME}
-)
-
-# Config files
-configure_file(
-  ${PROJECT_NAME}Config.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
-  @ONLY
-)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
-  @ONLY
-)
-
-export(EXPORT ${PROJECT_NAME}_TARGETS
-  FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake
-)
-
-set(config_package_location lib/cmake/${PROJECT_NAME})
-install(EXPORT ${PROJECT_NAME}_TARGETS
-  FILE ${PROJECT_NAME}Targets.cmake
-  DESTINATION ${config_package_location}
-)
-install(FILES
-    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
-    "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
-  DESTINATION ${config_package_location}
-)
diff --git a/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox b/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox
index 5babea66ab..2b93804d69 100644
--- a/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox
+++ b/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox
@@ -1,107 +1,107 @@
 /**
 \page thirdpartylibs Third-party libraries
 
 The following third-party libraries can be used with MITK by default and can, in part, be automatically downloaded during superbuild.
 
 \par ANN
 
 https://www.cs.umd.edu/~mount/ANN/
 
 \par Boost
 
 https://www.boost.org/
 
 \par C++ REST SDK
 
 https://github.com/Microsoft/cpprestsdk/
 
 \par CppUnit
 
 https://sourceforge.net/projects/cppunit/
 
 \par CTK
 
 https://commontk.org/
 
 \par DCMTK
 
 https://dicom.offis.de/dcmtk
 
 \par Eigen
 
 http://eigen.tuxfamily.org/index.php?title=Main_Page
 
 \par GDCM
 
 https://gdcm.sourceforge.net/
 
 \par HDF5
 
 https://support.hdfgroup.org/HDF5/
 
 \par ITK
 
 https://itk.org/
 
 \par MatchPoint
 
 https://www.dkfz.de/en/sidt/projects/MatchPoint/info.html
 
 \par OpenCL
 
 https://www.khronos.org/opencl/
 
 \par OpenCV
 
 https://opencv.org/
 
 \par OpenIGTLink
 
 http://openigtlink.org/
 
 \par OpenMesh
 
 https://www.openmesh.org/
 
 \par PCRE
 
 https://www.pcre.org/
 
 \par POCO
 
 https://pocoproject.org/
 
 \par Python
 
 https://www.python.org/
 
 \par Qt
 
 https://www.qt.io/
 
 \par Qwt
 
 http://qwt.sourceforge.net/
 
 \par SWIG
 
 http://www.swig.org/
 
-\par tinyxml
+\par TinyXML-2
 
-http://www.grinninglizard.com/tinyxml/
+http://www.grinninglizard.com/tinyxml2/
 
 \par VIGRA
 
 https://ukoethe.github.io/vigra/
 
 \par VTK
 
 https://vtk.org/
 
 \par zlib
 
 https://zlib.net/
 
 For copyright information on any of the above toolkits see the corresponding home page or the corresponding source folder.
 */
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/CMakeLists.txt b/Examples/FirstSteps/NewModule/autoload/IO/CMakeLists.txt
index 24b2612a99..06b8804507 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/CMakeLists.txt
+++ b/Examples/FirstSteps/NewModule/autoload/IO/CMakeLists.txt
@@ -1,8 +1,14 @@
 MITK_CREATE_MODULE( NewModuleIO
   INCLUDE_DIRS
     PRIVATE src/IO
   DEPENDS PUBLIC MitkNewModule MitkSceneSerialization
   PACKAGE_DEPENDS
-    PRIVATE tinyxml
+    PRIVATE tinyxml2|tinyxml2
   AUTOLOAD_WITH MitkCore
 )
+
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
diff --git a/Modules/CEST/autoload/IO/resource/cest_DKFZ.xml b/Modules/CEST/autoload/IO/resource/cest_DKFZ.xml
index b87f554740..6a35902e76 100644
--- a/Modules/CEST/autoload/IO/resource/cest_DKFZ.xml
+++ b/Modules/CEST/autoload/IO/resource/cest_DKFZ.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="DKFZ internal CEST image configuration"
   description="Based on ClassicDICOMSeriesReader for 3D+t images"
   class="ClassicDICOMSeriesReader"
   version="2"
   group3DnT="true"
   fixTiltByShearing="true"
   onlyCondenseSameSeries="false"
   >
-</DICOMFileReader>
\ No newline at end of file
+</DICOMFileReader>
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsics.cpp b/Modules/CameraCalibration/mitkCameraIntrinsics.cpp
index cb81b0f60b..fbb1ce2894 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsics.cpp
+++ b/Modules/CameraCalibration/mitkCameraIntrinsics.cpp
@@ -1,507 +1,508 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkCameraIntrinsics.h"
 #include <itkMutexLockHolder.h>
 #include <mitkEndoMacros.h>
 #include <mitkEndoDebug.h>
+#include <tinyxml2.h>
 
 mitk::CameraIntrinsics::CameraIntrinsics()
   : m_Valid(false), m_Mutex(itk::FastMutexLock::New())
 {
   m_CameraMatrix = cv::Mat::zeros(3, 3, cv::DataType<double>::type);
   m_CameraMatrix.at<double>(2,2) = 1.0;
   m_DistorsionCoeffs = cv::Mat::zeros(1, 5, cv::DataType<double>::type);
 }
 
 mitk::CameraIntrinsics::CameraIntrinsics(const CameraIntrinsics& other)
   : itk::Object()
   , mitk::XMLSerializable()
   , m_Valid(false)
   , m_Mutex(itk::FastMutexLock::New())
 {
   this->Copy(&other);
 }
 
 mitk::CameraIntrinsics::~CameraIntrinsics()
 {
 
 }
 
 bool mitk::CameraIntrinsics::Equals( const CameraIntrinsics* other ) const
 {
   return other->GetDistorsionCoeffsAsPoint4D()==
       this->GetDistorsionCoeffsAsPoint4D() &&
     other->GetFocalPoint()==
       this->GetFocalPoint() &&
     other->GetPrincipalPoint()
       == this->GetPrincipalPoint();
 }
 
 void mitk::CameraIntrinsics::Copy(const CameraIntrinsics* other)
 {
   this->SetIntrinsics( other->GetCameraMatrix().clone()
     , other->GetDistorsionCoeffs().clone() );
   this->SetValid(other->m_Valid);
 }
 
 bool mitk::CameraIntrinsics::IsValid() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   return m_Valid;
 }
 
 vnl_matrix_fixed<mitk::ScalarType, 3, 3>
     mitk::CameraIntrinsics::GetVnlCameraMatrix() const
 {
   vnl_matrix_fixed<mitk::ScalarType, 3, 3> mat;
   mat.set_identity();
 
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     mat(0,0) = m_CameraMatrix.at<double>(0,0);
     mat(1,1) = m_CameraMatrix.at<double>(1,1);
 
     mat(0,2) = m_CameraMatrix.at<double>(0,2);
     mat(1,2) = m_CameraMatrix.at<double>(1,2);
   }
 
   return mat;
 }
 
 void mitk::CameraIntrinsics::SetCameraMatrix(
     const vnl_matrix_fixed<mitk::ScalarType, 3, 3>& _CameraMatrix )
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   m_CameraMatrix.at<double>(0,0) = _CameraMatrix(0,0);
   m_CameraMatrix.at<double>(1,1) = _CameraMatrix(1,1);
 
   m_CameraMatrix.at<double>(0,2) = _CameraMatrix(0,2);
   m_CameraMatrix.at<double>(1,2) = _CameraMatrix(1,2);
 }
 
 vnl_matrix_fixed<mitk::ScalarType, 3, 4>
     mitk::CameraIntrinsics::GetVnlCameraMatrix3x4() const
 {
   vnl_matrix_fixed<mitk::ScalarType, 3, 4> mat;
   mat.fill(0);
   mat.update( this->GetVnlCameraMatrix().as_matrix() );
 
   return mat;
 }
 
 void mitk::CameraIntrinsics::SetIntrinsics( const cv::Mat& _CameraMatrix
                         , const cv::Mat& _DistorsionCoeffs)
 {
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     if( _CameraMatrix.cols != 3 || _CameraMatrix.rows != 3)
       throw std::invalid_argument("Wrong format of camera matrix. Should be 3x3"
                                   " double.");
 
     endoAssertMsg( (_DistorsionCoeffs.cols == 5) &&
       _DistorsionCoeffs.rows == 1, "Wrong format of distorsion coefficients"
                                   " vector. Should be 5x1 double.");
 
     m_CameraMatrix = _CameraMatrix.clone();
     m_DistorsionCoeffs = _DistorsionCoeffs.clone();
 
     m_Valid = true;
   }
   this->Modified();
 }
 
 void mitk::CameraIntrinsics::SetIntrinsics( const mitk::Point3D& focalPoint,
                     const mitk::Point3D& principalPoint,
                     const mitk::Point4D& distortionCoefficients)
 
 {
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     m_CameraMatrix.at<double>(0,0) = focalPoint[0];
     m_CameraMatrix.at<double>(1,1) = focalPoint[1];
 
     m_CameraMatrix.at<double>(0,2) = principalPoint[0];
     m_CameraMatrix.at<double>(1,2) = principalPoint[1];
 
     m_DistorsionCoeffs.at<double>(0,0) = distortionCoefficients[0];
     m_DistorsionCoeffs.at<double>(0,1) = distortionCoefficients[1];
     m_DistorsionCoeffs.at<double>(0,2) = distortionCoefficients[2];
     m_DistorsionCoeffs.at<double>(0,3) = distortionCoefficients[3];
   }
   this->Modified();
 }
 
 void mitk::CameraIntrinsics::SetFocalLength( double x, double y )
 {
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     m_CameraMatrix.at<double>(0,0) = x;
     m_CameraMatrix.at<double>(1,1) = y;
   }
   this->Modified();
 }
 
 void mitk::CameraIntrinsics::SetPrincipalPoint( double x, double y )
 {
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     m_CameraMatrix.at<double>(0,2) = x;
     m_CameraMatrix.at<double>(1,2) = y;
   }
   this->Modified();
 }
 
 void mitk::CameraIntrinsics::SetDistorsionCoeffs( double k1, double k2,
                                                  double p1, double p2 )
 {
 
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
 
     m_DistorsionCoeffs.at<double>(0,0) = k1;
     m_DistorsionCoeffs.at<double>(0,1) = k2;
     m_DistorsionCoeffs.at<double>(0,2) = p1;
     m_DistorsionCoeffs.at<double>(0,3) = p2;
   }
   this->Modified();
 }
 
 cv::Mat mitk::CameraIntrinsics::GetCameraMatrix() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   return m_CameraMatrix.clone(); // return a copy of this small matrix
 }
 
 cv::Mat mitk::CameraIntrinsics::GetDistorsionCoeffs() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   return m_DistorsionCoeffs.clone(); // return a copy of this small matrix
 }
 
 cv::Mat mitk::CameraIntrinsics::GetDistorsionCoeffs()
 {
   const CameraIntrinsics* intrinsics = this;
   return intrinsics->GetDistorsionCoeffs();
 }
 
 std::string mitk::CameraIntrinsics::ToString() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   std::ostringstream s; s.precision(12);
   const cv::Mat& CameraMatrix = m_CameraMatrix;
   const cv::Mat& DistorsionCoeffs = m_DistorsionCoeffs;
 
   s.str(""); s << this->GetNameOfClass() << ": ";
   s << "fx = " << CameraMatrix.at<double>(0,0);
   s << ", fy = " << CameraMatrix.at<double>(1,1);
   s << ", cx = " << CameraMatrix.at<double>(0,2);
   s << ", cy = " << CameraMatrix.at<double>(1,2);
 
   s << ", k1 = " << DistorsionCoeffs.at<double>(0,0);
   s << ", k2 = " << DistorsionCoeffs.at<double>(0,1);
   s << ", p1 = " << DistorsionCoeffs.at<double>(0,2);
   s << ", p2 = " << DistorsionCoeffs.at<double>(0,3);
   //s << ", k3 = " << DistorsionCoeffs.at<double>(0,4);
 
   return s.str();
 }
 
-void mitk::CameraIntrinsics::ToXML(TiXmlElement* elem) const
+void mitk::CameraIntrinsics::ToXML(tinyxml2::XMLElement* elem) const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   elem->SetValue(this->GetNameOfClass());
   std::ostringstream s; s.precision(12);
   const cv::Mat& CameraMatrix = m_CameraMatrix;
   s.str(""); s << CameraMatrix.at<double>(0,0);
-  elem->SetAttribute( "fx", s.str() );
+  elem->SetAttribute( "fx", s.str().c_str() );
   s.str(""); s << CameraMatrix.at<double>(1,1);
-  elem->SetAttribute( "fy", s.str() );
+  elem->SetAttribute( "fy", s.str().c_str());
   s.str(""); s << CameraMatrix.at<double>(0,2);
-  elem->SetAttribute( "cx", s.str() );
+  elem->SetAttribute( "cx", s.str().c_str());
   s.str(""); s << CameraMatrix.at<double>(1,2);
-  elem->SetAttribute( "cy", s.str() );
+  elem->SetAttribute( "cy", s.str().c_str());
 
   const cv::Mat& DistorsionCoeffs = m_DistorsionCoeffs;
   s.str(""); s << DistorsionCoeffs.at<double>(0,0);
-  elem->SetAttribute( "k1", s.str() );
+  elem->SetAttribute( "k1", s.str().c_str());
   s.str(""); s << DistorsionCoeffs.at<double>(0,1);
-  elem->SetAttribute( "k2", s.str() );
+  elem->SetAttribute( "k2", s.str().c_str());
   s.str(""); s << DistorsionCoeffs.at<double>(0,2);
-  elem->SetAttribute( "p1", s.str() );
+  elem->SetAttribute( "p1", s.str().c_str());
   s.str(""); s << DistorsionCoeffs.at<double>(0,3);
-  elem->SetAttribute( "p2", s.str() );
-  elem->SetAttribute("Valid", m_Valid);
+  elem->SetAttribute( "p2", s.str().c_str());
+  elem->SetAttribute("Valid", static_cast<int>(m_Valid));
   //s.str(""); s << DistorsionCoeffs.at<double>(4,0);
-  //elem->SetAttribute( "k3", s.str() );
+  //elem->SetAttribute( "k3", s.str().c_str() );
 }
 
-void mitk::CameraIntrinsics::FromGMLCalibrationXML(TiXmlElement* elem)
+void mitk::CameraIntrinsics::FromGMLCalibrationXML(const tinyxml2::XMLElement* elem)
 {
   assert( elem );
-  assert( elem->ValueStr() == "results" );
+  assert( std::string(elem->Value()) == "results" );
   cv::Mat CameraMatrix = cv::Mat::zeros(3, 3, cv::DataType<double>::type);
   CameraMatrix.at<double>(2,2) = 1.0;
   cv::Mat DistorsionCoeffs = cv::Mat::zeros(1, 5, cv::DataType<double>::type);
 
-  TiXmlElement* focus_lenXElem = elem->FirstChildElement("focus_lenX");
+  const auto* focus_lenXElem = elem->FirstChildElement("focus_lenX");
   endoAssert( focus_lenXElem != nullptr );
   CameraMatrix.at<double>(0,0) = atof( focus_lenXElem->GetText() );
 
-  TiXmlElement* focus_lenYElem = elem->FirstChildElement("focus_lenY");
+  const auto* focus_lenYElem = elem->FirstChildElement("focus_lenY");
   endoAssert( focus_lenYElem != nullptr );
   CameraMatrix.at<double>(1,1) = atof( focus_lenYElem->GetText() );
 
-  TiXmlElement* PrincipalXElem = elem->FirstChildElement("PrincipalX");
+  const auto* PrincipalXElem = elem->FirstChildElement("PrincipalX");
   endoAssert( PrincipalXElem != nullptr );
   CameraMatrix.at<double>(0,2) = atof( PrincipalXElem->GetText() );
 
-  TiXmlElement* PrincipalYElem = elem->FirstChildElement("PrincipalY");
+  const auto* PrincipalYElem = elem->FirstChildElement("PrincipalY");
   endoAssert( PrincipalYElem != nullptr );
   CameraMatrix.at<double>(1,2) = atof( PrincipalYElem->GetText() );
 
   // DISTORSION COEFFS
 
-  TiXmlElement* Dist1Elem = elem->FirstChildElement("Dist1");
+  const auto* Dist1Elem = elem->FirstChildElement("Dist1");
   endoAssert( Dist1Elem != nullptr );
   DistorsionCoeffs.at<double>(0,0) = atof( Dist1Elem->GetText() );
 
-  TiXmlElement* Dist2Elem = elem->FirstChildElement("Dist2");
+  const auto* Dist2Elem = elem->FirstChildElement("Dist2");
   endoAssert( Dist2Elem != nullptr );
   DistorsionCoeffs.at<double>(0,1) = atof( Dist2Elem->GetText() );
 
-  TiXmlElement* Dist3Elem = elem->FirstChildElement("Dist3");
+  const auto* Dist3Elem = elem->FirstChildElement("Dist3");
   endoAssert( Dist3Elem != nullptr );
   DistorsionCoeffs.at<double>(0,2) = atof( Dist3Elem->GetText() );
 
-  TiXmlElement* Dist4Elem = elem->FirstChildElement("Dist4");
+  const auto* Dist4Elem = elem->FirstChildElement("Dist4");
   endoAssert( Dist4Elem != nullptr );
   DistorsionCoeffs.at<double>(0,3) = atof( Dist4Elem->GetText() );
 
   int valid = 0;
   elem->QueryIntAttribute("Valid", &valid);
 
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     m_Valid = static_cast<bool>(valid);
     m_CameraMatrix = CameraMatrix;
     m_DistorsionCoeffs = DistorsionCoeffs;
   }
 
   this->Modified();
 }
 
-void mitk::CameraIntrinsics::FromXML(TiXmlElement* elem)
+void mitk::CameraIntrinsics::FromXML(const tinyxml2::XMLElement* elem)
 {
   endoAssert ( elem );
   MITK_DEBUG << elem->Value();
-  std::string filename;
-  if(elem->QueryStringAttribute("file", &filename) == TIXML_SUCCESS)
+  const char* filename = elem->Attribute("file");
+  if(nullptr != filename)
   {
     this->FromXMLFile(filename);
     return;
   }
   else if(strcmp(elem->Value(), "CalibrationProject") == 0)
   {
     this->FromGMLCalibrationXML(elem->FirstChildElement("results"));
     return;
   }
 
   assert ( elem );
   if(strcmp(elem->Value(), this->GetNameOfClass()) != 0)
     elem = elem->FirstChildElement(this->GetNameOfClass());
 
   std::ostringstream err;
   // CAMERA MATRIX
   cv::Mat CameraMatrix = cv::Mat::zeros(3, 3, cv::DataType<double>::type);
   CameraMatrix.at<double>(2,2) = 1.0;
   double val = 0.0;
-  if(elem->QueryDoubleAttribute("fx", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("fx", &val) == tinyxml2::XML_SUCCESS)
     CameraMatrix.at<double>(0,0) = val;
   else
     err << "fx, ";
 
-  if(elem->QueryDoubleAttribute("fy", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("fy", &val) == tinyxml2::XML_SUCCESS)
     CameraMatrix.at<double>(1,1) = val;
   else
     err << "fy, ";
 
-  if(elem->QueryDoubleAttribute("cx", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("cx", &val) == tinyxml2::XML_SUCCESS)
     CameraMatrix.at<double>(0,2) = val;
   else
     err << "cx, ";
 
-  if(elem->QueryDoubleAttribute("cy", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("cy", &val) == tinyxml2::XML_SUCCESS)
     CameraMatrix.at<double>(1,2) = val;
   else
     err << "cy, ";
 
   // DISTORSION COEFFS
   endodebug( "creating DistorsionCoeffs from XML file")
   cv::Mat DistorsionCoeffs = cv::Mat::zeros(1, 5, cv::DataType<double>::type);
-  if(elem->QueryDoubleAttribute("k1", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("k1", &val) == tinyxml2::XML_SUCCESS)
     DistorsionCoeffs.at<double>(0,0) = val;
   else
     err << "k1, ";
 
-  if(elem->QueryDoubleAttribute("k2", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("k2", &val) == tinyxml2::XML_SUCCESS)
     DistorsionCoeffs.at<double>(0,1) = val;
   else
     err << "k2, ";
 
-  if(elem->QueryDoubleAttribute("p1", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("p1", &val) == tinyxml2::XML_SUCCESS)
     DistorsionCoeffs.at<double>(0,2) = val;
   else
     err << "p1, ";
 
-  if(elem->QueryDoubleAttribute("p2", &val) == TIXML_SUCCESS)
+  if(elem->QueryDoubleAttribute("p2", &val) == tinyxml2::XML_SUCCESS)
     DistorsionCoeffs.at<double>(0,3) = val;
   else
     err << "p2, ";
 
   DistorsionCoeffs.at<double>(0,4) = 0.0;
 
-  /*if(elem->QueryDoubleAttribute("k3", &val) == TIXML_SUCCESS)
+  /*if(elem->QueryDoubleAttribute("k3", &val) == tinyxml2::XML_SUCCESS)
     DistorsionCoeffs.at<double>(4,0) = val;
   else
     err << "k3, ";*/
 
   std::string errorStr = err.str();
   int errLength = errorStr.length();
   if(errLength > 0)
   {
     errorStr = errorStr.substr(0, errLength-2);
     errorStr.append(" not found");
     throw std::invalid_argument(err.str());
   }
 
   int valid = 0;
   elem->QueryIntAttribute("Valid", &valid);
 
   {
     itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
     m_Valid = static_cast<bool>(valid);
     m_CameraMatrix = CameraMatrix;
     m_DistorsionCoeffs = DistorsionCoeffs;
   }
 
   this->Modified();
 }
 
 double mitk::CameraIntrinsics::GetFocalLengthX() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   double FocalLengthX = m_CameraMatrix.at<double>(0,0);
 
   return FocalLengthX;
 }
 double mitk::CameraIntrinsics::GetFocalLengthY() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   double FocalLengthY = m_CameraMatrix.at<double>(1,1);;
   return FocalLengthY;
 }
 double mitk::CameraIntrinsics::GetPrincipalPointX() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   double PrincipalPointX = m_CameraMatrix.at<double>(0,2);
   return PrincipalPointX;
 }
 double mitk::CameraIntrinsics::GetPrincipalPointY() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   double PrincipalPointY = m_CameraMatrix.at<double>(1,2);
   return PrincipalPointY;
 }
 mitk::Point4D mitk::CameraIntrinsics::GetDistorsionCoeffsAsPoint4D() const
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   mitk::Point4D coeffs;
 
   coeffs[0] = m_DistorsionCoeffs.at<double>(0,0);
   coeffs[1] = m_DistorsionCoeffs.at<double>(0,1);
   coeffs[2] = m_DistorsionCoeffs.at<double>(0,2);
   coeffs[3] = m_DistorsionCoeffs.at<double>(0,3);
 
   return coeffs;
 }
 
 mitk::Point3D mitk::CameraIntrinsics::GetFocalPoint() const
 {
   mitk::Point3D p;
   p[0] = this->GetFocalLengthX();
   p[1] = this->GetFocalLengthY();
   p[2] = 0;
   return p;
 }
 
 mitk::Point3D mitk::CameraIntrinsics::GetPrincipalPoint() const
 {
   mitk::Point3D p;
   p[0] = this->GetPrincipalPointX();
   p[1] = this->GetPrincipalPointY();
   p[2] = 0;
   return p;
 }
 
 vnl_vector_fixed<mitk::ScalarType, 2>
      mitk::CameraIntrinsics::GetFocalPointAsVnlVector() const
 {
   vnl_vector_fixed<mitk::ScalarType, 2> vec;
   vec[0] = this->GetFocalLengthX();
   vec[1] = this->GetFocalLengthY();
   return vec;
 }
 
 vnl_vector_fixed<mitk::ScalarType, 2>
      mitk::CameraIntrinsics::GetPrincipalPointAsVnlVector() const
 {
   vnl_vector_fixed<mitk::ScalarType, 2> vec;
   vec[0] = this->GetPrincipalPointX();
   vec[1] = this->GetPrincipalPointY();
   return vec;
 }
 
 std::ostream& operator<< (std::ostream& os, mitk::CameraIntrinsics::Pointer p)
 {
   os << p->ToString();
   return os;
 }
 
 std::string mitk::CameraIntrinsics::GetString()
 {
   return this->ToString();
 }
 
 std::string mitk::CameraIntrinsics::ToOctaveString(
     const std::string& varName)
 {
   std::ostringstream s;
   s << varName << " = [" << this->GetFocalLengthX() << " 0 "
       << this->GetPrincipalPointX() << "; 0 " <<
       this->GetFocalLengthY() << " " << this->GetPrincipalPointY() << ";"
       << " 0 0 1 ];";
   return s.str();
 }
 
 void mitk::CameraIntrinsics::SetValid( bool valid )
 {
   itk::MutexLockHolder<itk::FastMutexLock> lock(*m_Mutex);
   m_Valid = valid;
 }
 
 itk::LightObject::Pointer mitk::CameraIntrinsics::InternalClone() const
 {
   itk::LightObject::Pointer result(new Self(*this));
   result->UnRegister();
   return result;
 }
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsics.h b/Modules/CameraCalibration/mitkCameraIntrinsics.h
index a6004b8960..a36cbf0a7f 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsics.h
+++ b/Modules/CameraCalibration/mitkCameraIntrinsics.h
@@ -1,141 +1,141 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef mitkCameraIntrinsics_h
 #define mitkCameraIntrinsics_h
 
 #include <mitkCommon.h>
 #include <mitkNumericTypes.h>
 #include <itkDataObject.h>
 #include <itkFastMutexLock.h>
 #include <vnl/vnl_matrix_fixed.h>
 #include "mitkXMLSerializable.h"
 #include <MitkCameraCalibrationExports.h>
 
 #include "opencv2/core.hpp"
 
 int mitkCameraIntrinsicsTest(int, char* []);
 
 namespace mitk
 {
   ///
   /// \brief class representing camera intrinsics and related functions
   ///
   class MITKCAMERACALIBRATION_EXPORT CameraIntrinsics: virtual public itk::Object,
     virtual public mitk::XMLSerializable
   {
   public:
     ///
     /// for testing purposes
     ///
     friend int mitkCameraIntrinsicsTest(int argc, char* argv[]);
     ///
     /// smartpointer typedefs
     ///
     mitkClassMacroItkParent(CameraIntrinsics, itk::Object);
     ///
     /// the static new function
     ///
     itkFactorylessNewMacro(Self);
 
     ///
     /// make a clone of this intrinsics
     ///
     itkCloneMacro(Self);
 
     ///
     /// copy information from other to this
     ///
     void Copy(const CameraIntrinsics* other);
 
     ///
     /// checks two intrinsics for equality
     ///
     bool Equals( const CameraIntrinsics* other ) const;
 
     ///
     /// \return the intrinsic parameter matrix as a 3x3 vnl matrix
     ///
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlCameraMatrix() const;
 
     ///
     /// \return the intrinsic parameter matrix as a 3x4 vnl matrix
     /// (the last column only containing zeros)
     ///
     vnl_matrix_fixed<mitk::ScalarType, 3, 4> GetVnlCameraMatrix3x4() const;
 
     ///
     /// \return true if the intrinsics are set (some plausibility checks
     /// may be done here)
     ///
     bool IsValid() const;
     void SetValid(bool valid);
     cv::Mat GetCameraMatrix() const;
     cv::Mat GetDistorsionCoeffs();
     cv::Mat GetDistorsionCoeffs() const;
-    void ToXML(TiXmlElement* elem) const override;
+    void ToXML(tinyxml2::XMLElement* elem) const override;
     std::string ToString() const;
     std::string GetString();
     double GetFocalLengthX() const;
     double GetFocalLengthY() const;
     double GetPrincipalPointX() const;
     double GetPrincipalPointY() const;
     mitk::Point4D GetDistorsionCoeffsAsPoint4D() const;
     mitk::Point3D GetFocalPoint() const;
     mitk::Point3D GetPrincipalPoint() const;
     vnl_vector_fixed<mitk::ScalarType, 2> GetFocalPointAsVnlVector() const;
     vnl_vector_fixed<mitk::ScalarType, 2> GetPrincipalPointAsVnlVector() const;
 
     ///
     /// set a new camera matrix utilizing a vnl matrix
     ///
     void SetCameraMatrix( const vnl_matrix_fixed<mitk::ScalarType, 3, 3>&
                         _CameraMatrix );
 
     void SetIntrinsics( const cv::Mat& _CameraMatrix
                         , const cv::Mat& _DistorsionCoeffs);
 
     void SetFocalLength( double x, double y );
     void SetPrincipalPoint( double x, double y );
     void SetDistorsionCoeffs( double k1, double k2, double p1, double p2 );
 
     void SetIntrinsics( const mitk::Point3D& focalPoint,
                         const mitk::Point3D& principalPoint,
                         const mitk::Point4D& distortionCoefficients);
 
-    void FromXML(TiXmlElement* elem) override;
-    void FromGMLCalibrationXML(TiXmlElement* elem);
+    void FromXML(const tinyxml2::XMLElement* elem) override;
+    void FromGMLCalibrationXML(const tinyxml2::XMLElement* elem);
     std::string ToOctaveString(const std::string& varName="CameraIntrinsics");
 
     ~CameraIntrinsics() override;
 
   protected:
     CameraIntrinsics();
     CameraIntrinsics(const CameraIntrinsics& other);
 
     cv::Mat m_CameraMatrix;
     cv::Mat m_DistorsionCoeffs;
     bool m_Valid;
     itk::FastMutexLock::Pointer m_Mutex;
 
   private:
 
     itk::LightObject::Pointer InternalClone() const override;
   };
 
 } // namespace mitk
 
 MITKCAMERACALIBRATION_EXPORT std::ostream& operator<<
     (std::ostream& os, mitk::CameraIntrinsics::Pointer p);
 
 #endif // mitkCameraIntrinsics_h
diff --git a/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.cpp b/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.cpp
index a88a588b80..e9b827e034 100644
--- a/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.cpp
+++ b/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.cpp
@@ -1,159 +1,169 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkEndoDebugFromXmlFile.h"
 #include <itksys/SystemTools.hxx>
-#include <tinyxml.h>
+#include <tinyxml2.h>
 #include <set>
 using namespace std;
 
 namespace mitk
 {
   struct EndoDebugFromXmlFileData
   {
     const std::string* m_FileName;
 
     // private
     EndoDebug* m_EndoDebug;
     long int m_FileModifiedTime;
   };
 
   EndoDebugFromXmlFile::EndoDebugFromXmlFile(
       const std::string* _FileName, EndoDebug* _EndoDebug )
     : d( new EndoDebugFromXmlFileData )
   {
       d->m_FileName = _FileName;
       d->m_EndoDebug = _EndoDebug;
       d->m_FileModifiedTime = 0;
   }
 
   EndoDebugFromXmlFile::~EndoDebugFromXmlFile()
   {
     delete d;
   }
 
   void StringExplode(string str, string separator, set<string>* results){
       std::size_t found;
       found = str.find_first_of(separator);
       while(found != string::npos){
           if(found != 0){
               results->insert(str.substr(0,found));
           }
           str = str.substr(found+1);
           found = str.find_first_of(separator);
       }
       if(!str.empty()){
           results->insert(str);
       }
   }
 
 #ifdef _MSC_VER
 #  pragma warning(push)
 #  pragma warning(disable:4390)
 #endif
 
   void EndoDebugFromXmlFile::Update()
   {
     endodebug( __FUNCTION__ )
 
     std::string _FileName = *d->m_FileName;
     if( !itksys::SystemTools::FileExists( _FileName.c_str() ) )
     {
       endodebug(_FileName << " does not exist");
       return;
     }
 
     long int _FileModifiedTime
       = itksys::SystemTools::ModifiedTime( _FileName.c_str() );
     // file has changed: we know an older version...
     if( d->m_FileModifiedTime >= _FileModifiedTime )
     {
         endodebug("File not changed. No Update necessary.");
         return;
     }
 
     // reread
-    endodebugvar( _FileName )
-    TiXmlDocument doc( _FileName );
-    doc.LoadFile();
-    TiXmlHandle docHandle( &doc );
-    TiXmlElement* elem = docHandle.FirstChildElement().FirstChildElement( "EndoDebug" ).ToElement();
+    endodebugvar(_FileName)
+    tinyxml2::XMLDocument doc;
+    doc.LoadFile(_FileName.c_str());
+    tinyxml2::XMLHandle docHandle(&doc);
+    auto* elem = docHandle.FirstChildElement().FirstChildElement( "EndoDebug" ).ToElement();
 
     if(elem == nullptr)
     {
       endodebug("EndoDebug element not found");
       return;
     }
 
     int _DebugEnabled = d->m_EndoDebug->GetDebugEnabled();
-    if( elem->QueryIntAttribute("DebugEnabled",&_DebugEnabled) != TIXML_SUCCESS )
+    if( elem->QueryIntAttribute("DebugEnabled",&_DebugEnabled) != tinyxml2::XML_SUCCESS )
     {
       endodebug("DebugEnabled attribute not found");
     }
 
     int _ShowImagesInDebug = d->m_EndoDebug->GetShowImagesInDebug();
-    if( elem->QueryIntAttribute("ShowImagesInDebug",&_ShowImagesInDebug) != TIXML_SUCCESS )
+    if( elem->QueryIntAttribute("ShowImagesInDebug",&_ShowImagesInDebug) != tinyxml2::XML_SUCCESS)
     {
       endodebug("ShowImagesInDebug attribute not found");
     }
 
     int _ShowImagesTimeOut = static_cast<int>(d->m_EndoDebug->GetShowImagesTimeOut());
-    if( elem->QueryIntAttribute("ShowImagesTimeOut",&_ShowImagesTimeOut) != TIXML_SUCCESS )
+    if( elem->QueryIntAttribute("ShowImagesTimeOut",&_ShowImagesTimeOut) != tinyxml2::XML_SUCCESS)
     {
       endodebug("ShowImagesTimeOut attribute not found");
     }
 
-    std::string _DebugImagesOutputDirectory = d->m_EndoDebug->GetDebugImagesOutputDirectory();
-    if( elem->QueryStringAttribute("DebugImagesOutputDirectory",&_DebugImagesOutputDirectory) != TIXML_SUCCESS )
+    std::string _DebugImagesOutputDirectory;
+    const char* _DebugImagesOutputDirectoryC = elem->Attribute("DebugImagesOutputDirectory");
+    if(nullptr == _DebugImagesOutputDirectoryC)
     {
+      _DebugImagesOutputDirectory = d->m_EndoDebug->GetDebugImagesOutputDirectory();
       endodebug("DebugImagesOutputDirectory attribute not found");
     }
+    else
+    {
+      _DebugImagesOutputDirectory = _DebugImagesOutputDirectoryC;
+    }
 
     std::set<std::string> _FilesToDebug;
     std::string _FilesToDebugString;
-    if( elem->QueryStringAttribute("FilesToDebug",&_FilesToDebugString) != TIXML_SUCCESS )
+    const char* _FilesToDebugStringC = elem->Attribute("FilesToDebug");
+    if(nullptr == _FilesToDebugStringC)
     {
       endodebug("FilesToDebug attribute not found");
     }
     else
     {
-        StringExplode( _FilesToDebugString, ";", &_FilesToDebug );
+      _FilesToDebugString = _FilesToDebugStringC;
+      StringExplode( _FilesToDebugString, ";", &_FilesToDebug );
     }
 
     std::set<std::string> _SymbolsToDebug;
     std::string _SymbolsToDebugString;
-    if( elem->QueryStringAttribute("SymbolsToDebug",&_SymbolsToDebugString) != TIXML_SUCCESS )
+    const char* _SymbolsToDebugStringC = elem->Attribute("SymbolsToDebug");
+    if( nullptr == _SymbolsToDebugStringC )
     {
       endodebug("SymbolsToDebug attribute not found");
     }
     else
     {
-        StringExplode( _SymbolsToDebugString, ";", &_SymbolsToDebug );
+      _SymbolsToDebugString = _SymbolsToDebugStringC;
+      StringExplode( _SymbolsToDebugString, ";", &_SymbolsToDebug );
     }
 
     // save
     mitk::EndoDebug::GetInstance().SetDebugEnabled( _DebugEnabled == 1? true: false );
     mitk::EndoDebug::GetInstance().SetShowImagesInDebug( _ShowImagesInDebug == 1? true: false  );
     mitk::EndoDebug::GetInstance().SetShowImagesTimeOut( _ShowImagesTimeOut );
     mitk::EndoDebug::GetInstance().SetDebugImagesOutputDirectory( _DebugImagesOutputDirectory );
     mitk::EndoDebug::GetInstance().SetFilesToDebug(_FilesToDebug);
     mitk::EndoDebug::GetInstance().SetSymbolsToDebug(_SymbolsToDebug);
 
     // save that modified time
     d->m_FileModifiedTime = _FileModifiedTime;
   }
 
 #ifdef _MSC_VER
 #  pragma warning(pop)
 #endif
 
 }
diff --git a/Modules/CameraCalibration/mitkEndoDebugToXmlFile.cpp b/Modules/CameraCalibration/mitkEndoDebugToXmlFile.cpp
index 8e0a52463c..82a0e184c1 100644
--- a/Modules/CameraCalibration/mitkEndoDebugToXmlFile.cpp
+++ b/Modules/CameraCalibration/mitkEndoDebugToXmlFile.cpp
@@ -1,121 +1,122 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkEndoDebugToXmlFile.h"
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   struct EndoDebugToXmlFileData
   {
     EndoDebug* m_EndoDebug;
     const std::string* m_FileName;
   };
 
   EndoDebugToXmlFile::EndoDebugToXmlFile(EndoDebug *_EndoDebug,
     const std::string* _FileName)
     : d( new EndoDebugToXmlFileData )
   {
     d->m_EndoDebug = _EndoDebug;
     d->m_FileName = _FileName;
   }
 
   EndoDebugToXmlFile::~EndoDebugToXmlFile()
   {
     delete d;
   }
 
   void EndoDebugToXmlFile::Update()
   {
     std::string _FileName = *d->m_FileName;
 
-    TiXmlDocument doc( _FileName.c_str() );
-    TiXmlElement* root = nullptr;
-    TiXmlElement* elem = nullptr;
+    tinyxml2::XMLDocument doc;
+    tinyxml2::XMLElement* root = nullptr;
+    tinyxml2::XMLElement* elem = nullptr;
     // check if element is already available
-    if(doc.LoadFile())
+    if(tinyxml2::XML_SUCCESS == doc.LoadFile(_FileName.c_str()))
     {
       root = doc.FirstChildElement("data");
-      if(root)
+      if(nullptr != root)
       {
         elem = root->FirstChildElement( "EndoDebug" );
-        if(elem)
-          root->RemoveChild(elem);
-        elem = nullptr;
+        if (nullptr != elem)
+        {
+          root->DeleteChild(elem);
+          elem = nullptr;
+        }
       }
     }
     else
     {
       // document did not exist, create new one with declration
-      auto  decl = new TiXmlDeclaration( "1.0", "", "" );
-      doc.LinkEndChild( decl );
+      doc.InsertEndChild( doc.NewDeclaration() );
       // create root
-      root = new TiXmlElement( "data" );
-      doc.LinkEndChild( root );
+      root = doc.NewElement( "data" );
+      doc.InsertEndChild( root );
     }
 
     // create elem if not existent
-    elem = new TiXmlElement( "EndoDebug" );
+    elem = doc.NewElement( "EndoDebug" );
 
     elem->SetAttribute( "DebugEnabled",
                         (d->m_EndoDebug->GetDebugEnabled()? 1:0) );
     elem->SetAttribute( "ShowImagesInDebug",
                         (d->m_EndoDebug->GetShowImagesInDebug()? 1:0) );
     elem->SetAttribute( "ShowImagesTimeOut",
                         (static_cast<int>(d->m_EndoDebug->GetShowImagesTimeOut())) );
     elem->SetAttribute( "DebugImagesOutputDirectory",
-                        d->m_EndoDebug->GetDebugImagesOutputDirectory() );
+                        d->m_EndoDebug->GetDebugImagesOutputDirectory().c_str() );
 
     std::set<std::string> _FilesToDebug = d->m_EndoDebug->GetFilesToDebug();
     std::string _FilesToDebugString;
     auto it = _FilesToDebug.begin();
     while( it != _FilesToDebug.end() )
     {
         if( it != _FilesToDebug.begin() )
             _FilesToDebugString.append( ";" );
         _FilesToDebugString.append( *it );
         ++it;
     }
-    elem->SetAttribute( "FilesToDebug", _FilesToDebugString );
+    elem->SetAttribute( "FilesToDebug", _FilesToDebugString.c_str() );
 
     std::set<std::string> _SymbolsToDebug = d->m_EndoDebug->GetSymbolsToDebug();
     std::string _SymbolsToDebugString;
     it = _SymbolsToDebug.begin();
     while( it != _SymbolsToDebug.end() )
     {
         if( it != _SymbolsToDebug.begin() )
             _SymbolsToDebugString.append( ";" );
         _SymbolsToDebugString.append( *it );
         ++it;
     }
-    elem->SetAttribute( "SymbolsToDebug", _SymbolsToDebugString );
+    elem->SetAttribute( "SymbolsToDebug", _SymbolsToDebugString.c_str() );
 
     endodebug("adding the EndoDebug as child element of the data node")
-    root->LinkEndChild(elem);
+    root->InsertEndChild(elem);
 
     endodebug("saving file " << _FileName)
-    if( !doc.SaveFile( _FileName ) )
+    if( tinyxml2::XML_SUCCESS != doc.SaveFile( _FileName.c_str() ) )
     {
         endodebug("File " << _FileName << " could not be written. Please check permissions.");
     }
   }
 
   void EndoDebugToXmlFile::SetEndoDebug(EndoDebug *_EndoDebug)
   {
       d->m_EndoDebug = _EndoDebug;
   }
 
   void EndoDebugToXmlFile::SetFileName(const std::string *_FileName)
   {
       d->m_FileName = _FileName;
   }
 }
diff --git a/Modules/CameraCalibration/mitkTransform.cpp b/Modules/CameraCalibration/mitkTransform.cpp
index d77d2d87fe..0a65753afb 100644
--- a/Modules/CameraCalibration/mitkTransform.cpp
+++ b/Modules/CameraCalibration/mitkTransform.cpp
@@ -1,745 +1,750 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #include "mitkTransform.h"
 #include <fstream>
 #include <vnl/vnl_inverse.h>
 #include <mitkVnlVectorFixedCaster.h>
 #include <mitkVnlVectorFromCvMat.h>
 #include <mitkVnlMatrixFromCvMat.h>
 #include <mitkCvMatFromVnlVector.h>
+#include <tinyxml2.h>
+
 namespace mitk
 {
   // DO NOT CHANGE THE VALUES OF THESE CONSTANTS!!
   const std::string Transform::UNKNOWN_TYPE = "Unknown type";
   const std::string Transform::ENDOSCOPE_SCOPE_TOOL = "Endoscope scope tool";
   const std::string Transform::ENDOSCOPE_CAM_TOOL = "Endoscope camera tool";
   const std::string Transform::CHESSBOARD_TOOL = "Chessboard tool";
   const std::string Transform::POINTER_TOOL = "Pointer tool";
   const std::string Transform::POINTER_TO_CHESSBOARD_ORIGIN = "Pointer to chessboard origin";
   const std::string Transform::POINTER_TO_CHESSBOARD_X_SUPPORT_POINT = "Pointer to chessboard X support origin";
   const std::string Transform::POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT = "Pointer to chessboard Y support origin";
   const std::string Transform::BOARD_TO_BOARD_TOOL = "Board to board tool";
   const std::string Transform::REFERENCE_CAMERA_TRANSFORM = "Reference camera transform";
   const std::string Transform::REFERENCE_SCOPE_TRANSFORM = "Reference scope transform";
   const std::string Transform::EYE_TO_HAND_TRANSFORM = "Eye to hand transform";
   const std::string Transform::CAMERA_EXTRINSICS = "Camera extrinsics";
 
   Transform::Transform()
     : m_NavData(mitk::NavigationData::New()), m_Type( UNKNOWN_TYPE )
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> rot;
     rot.set_identity();
     this->SetRotation( rot );
   }
 
   Transform::Transform(const mitk::NavigationData* nd)
     : m_NavData(mitk::NavigationData::New()), m_Type( UNKNOWN_TYPE )
   {
         m_NavData->Graft(nd);
   }
 
   Transform::Transform(const std::string& s)
     : m_NavData(mitk::NavigationData::New()), m_Type( s )
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> rot;
     rot.set_identity();
     this->SetRotation( rot );
   }
 
   void Transform::Copy(const mitk::NavigationData* nd)
   {
     (const_cast<mitk::NavigationData*>(m_NavData.GetPointer()))->Graft(nd);
   }
 
   void Transform::Concatenate( mitk::Transform* transform )
   {
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> mat = transform->GetMatrix();
     mat = mat * this->GetMatrix(); //
     this->SetMatrix( mat );
 
   }
 
   void Transform::Concatenate( const vnl_matrix_fixed<mitk::ScalarType, 4, 4>&
                                transform )
   {
     Transform::Pointer t = Transform::New();
     t->SetMatrix( transform );
     this->Concatenate( t );
   }
 
   void Transform::Concatenate( const vtkMatrix4x4* transform )
   {
     Transform::Pointer t = Transform::New();
     t->SetMatrix( transform );
     this->Concatenate( t );
   }
 
   void Transform::Reset()
   {
     mitk::NavigationData::Pointer nd
       = NavigationData::New();
     this->Copy( nd );
   }
   void  Transform::SetOrientation(
       const vnl_quaternion<mitk::ScalarType>& orientation)
   {
     m_NavData->SetOrientation(orientation);
     this->Modified();
   }
 
   void Transform::SetTranslation( const vnl_vector_fixed<mitk::ScalarType, 3>&
                                   transl)
   {
     mitk::Point3D p;
     for(unsigned int i=0; i<3; ++i)
       p[i] = transl[i];
 
     m_NavData->SetPosition(p);
     this->Modified();
   }
 
   void Transform::SetTranslation( float* array )
   {
     vnl_vector_fixed<mitk::ScalarType, 3> vec;
     for(unsigned int i=0; i<vec.size(); i++)
       vec(i) = array[i];
     this->SetTranslation( vec );
   }
 
   void Transform::SetRotation( float* array )
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> mat;
 
     unsigned int row = 0;
     unsigned int col = 0;
     for(unsigned int i=0; i<mat.rows()*mat.cols(); i++)
     {
       if( i > 0 && i % 3 == 0 )
       {
         ++row;
         col = 0;
       }
 
       mat(row,col) = array[i];
       ++col;
     }
 
     this->SetRotation( mat );
   }
 
   void Transform::SetOrientation( const vnl_quaternion<float>& orientation)
   {
     vnl_vector_fixed<mitk::ScalarType, 4> qvec;
     VnlVectorFixedCaster<float, mitk::ScalarType, 4> caster( &orientation, &qvec );
     caster.Update();
 
     mitk::Quaternion p( qvec );
 
     this->SetOrientation( p );
   }
 
   vnl_vector_fixed<double, 3> Transform::GetVnlDoubleTranslation() const
   {
     vnl_vector_fixed<mitk::ScalarType, 3> vecFloat = this->GetVnlTranslation();
     vnl_vector_fixed<double, 3> vecDouble;
     VnlVectorFixedCaster<mitk::ScalarType, double, 3> caster( &vecFloat, &vecDouble );
     caster.Update();
 
     return vecDouble;
   }
 
   void Transform::SetTranslation( const vnl_vector<double>& transl)
   {
     vnl_vector_fixed<double, 3> dTransl(transl);
     vnl_vector_fixed<mitk::ScalarType, 3> fTransl;
     VnlVectorFixedCaster<double, mitk::ScalarType, 3> caster( &dTransl, &fTransl );
     caster.Update();
 
     this->SetTranslation( fTransl );
   }
 
   vnl_quaternion<double> Transform::GetVnlDoubleQuaternion() const
   {
     mitk::Quaternion fOrientation = this->GetOrientation();
     vnl_quaternion<double> dOrientation;
     VnlVectorFixedCaster<mitk::ScalarType, double, 4> caster( &fOrientation, &dOrientation );
     caster.Update();
 
     return dOrientation;
   }
 
   void Transform::FromCSVFile(const std::string& file)
   {
     std::ifstream csvFile (file.c_str());
     endoAssert ( csvFile.fail() == false );
 
     mitk::Transform::Pointer transform = mitk::Transform::New();
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> mat;
     std::string line;
     mitk::ScalarType d = 0.0f;
     int row=0,column = 0;
 
     while (std::getline (csvFile, line))
     {
       std::istringstream linestream(line);
       std::string item;
       column = 0;
       while (std::getline (linestream, item, ','))
       {
         std::istringstream number;
         number.str(item);
         number >> d;
         mat(row, column) = d;
         ++column;
       }
       ++row;
     }
     endoAssert( row == 4 && column == 4 );
     transform->SetMatrix( mat );
 
     this->SetNavigationData( transform->GetNavigationData() );
     // modified is called in SetNavigationData
   }
 
   std::string Transform::ToCSVString() const
   {
     std::ostringstream s; s.precision(12);
 
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> mat
       = this->GetMatrix();
 
     for( unsigned int j=0; j<mat.rows(); ++j )
     {
       for( unsigned int k=0; k<mat.cols(); ++k )
       {
         s << mat(j,k);
         if(k+1<mat.cols())
           s  << ",";
       }
       if(j+1<mat.rows())
         s << std::endl;
     }
 
     return s.str();
 
   }
 
   std::string Transform::ToMatlabString(const std::string& varname
                                         , bool printLastRow) const
   {
     std::ostringstream s; s.precision(12);
 
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> mat
       = this->GetMatrix();
 
     s << varname << " = [";
     for( unsigned int j=0; j<mat.rows(); ++j )
     {
       if( !printLastRow && j+1 == mat.rows() )
         break;
       for( unsigned int k=0; k<mat.cols(); ++k )
       {
         s << mat(j,k) << " ";
       }
       s << ";";
     }
     s << "];" << std::endl;
 
     return s.str();
   }
 
   void Transform::Copy( const mitk::Transform* transform )
   {
     m_NavData->Graft(transform->GetNavigationData());
     m_Type = transform->GetType();
   }
 
   mitk::Transform::Pointer Transform::Clone() const
   {
     Transform::Pointer copy = Transform::New();
     copy->Copy( this );
     return copy;
   }
 
   void Transform::SetMatrix( const vtkMatrix4x4* mat)
   {
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> vnlMat;
     for(unsigned int i=0; i<4; ++i)
       for(unsigned int j=0; j<4; ++j)
         vnlMat(i,j) = mat->GetElement(i, j);
 
     this->SetMatrix( vnlMat );
   }
 
   void Transform::ToCSVFile(const std::string& file) const
   {
     std::ofstream csvFile;
     csvFile.open(file.c_str());
     endoAssert ( csvFile.fail() == false );
     csvFile << this->ToCSVString();
     csvFile.close();
   }
 
   void Transform::ToMatlabFile(const std::string& file
                                , const std::string& varname) const
   {
     std::ofstream csvFile;
     csvFile.open(file.c_str());
     endoAssert ( csvFile.fail() == false );
     csvFile << this->ToMatlabString(varname);
     csvFile.close();
   }
 
   void Transform::SetNavigationData( const mitk::NavigationData* naviData )
   {
     endoAssert( naviData != nullptr );
     m_NavData->Graft( naviData );
     this->Modified();
   }
 
   void Transform::SetRotation( vnl_matrix_fixed<mitk::ScalarType, 3, 3>& mat)
   {
     this->m_NavData->SetOrientation( mitk::Quaternion(mat) );
     this->Modified();
   }
 
   void Transform::SetRotation( vnl_matrix<mitk::ScalarType>& mat)
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> tmp(mat);
     this->SetRotation( tmp );
   }
 
   void Transform::SetPosition( const mitk::Point3D& transl)
   {
     this->SetTranslation( transl.GetVnlVector() );
   }
 
   void Transform::SetTranslation( double array[3] )
   {
     mitk::Point3D p;
     for(unsigned int i = 0; i < 3; ++i)
       p.SetElement(i, array[i]);
     this->SetTranslation( p.GetVnlVector() );
   }
 
 
   void Transform::SetRotation( double array[3][3] )
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> mat;
 
     for(unsigned int i = 0; i < 3; ++i)
       for(unsigned int j = 0; j < 3; ++j)
         mat(i, j) = array[i][j];
     this->SetRotation( mat );
   }
 
   void Transform::Invert()
   {
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> tmp(this->GetMatrix());
     this->SetMatrix( vnl_inverse( tmp ) );
   }
 
   void Transform::SetMatrix(
      const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& mat)
   {
     // set translation first
     vnl_vector<mitk::ScalarType> transl = mat.get_column(3);
     mitk::Point3D p;
     for(unsigned int i=0; i<3; ++i)
       p[i] = transl[i];
 
     m_NavData->SetPosition(p);
 
     // set rotation
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> rotMatFixed(
       mat.extract(3,3));
     this->SetRotation(rotMatFixed);
   }
 
   bool Transform::IsValid() const
   {
     return m_NavData->IsDataValid();
   }
 
   void Transform::SetTranslation( const cv::Mat& transl)
   {
     vnl_vector<mitk::ScalarType> vec(3);
     VnlVectorFromCvMat<mitk::ScalarType> _VnlVectorFromCvMat( &transl, &vec );
     _VnlVectorFromCvMat.Update();
     this->SetTranslation( vnl_vector_fixed<mitk::ScalarType, 3>( vec ) );
   }
 
   void Transform::SetRotation( const cv::Mat& mat )
   {
     vnl_matrix<mitk::ScalarType> vnlMat(3, 3);
     VnlMatrixFromCvMat<mitk::ScalarType> _VnlMatrixFromCvMat( &mat, &vnlMat );
     _VnlMatrixFromCvMat.Update();
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> vnlMatFixed(vnlMat);
 
     this->SetRotation(vnlMatFixed);
   }
 
   void Transform::SetRotationVector( const cv::Mat& rotVec )
   {
     cv::Mat rotMat;
     cv::Rodrigues( rotVec, rotMat );
 
     vnl_matrix<mitk::ScalarType> vnlMat(3, 3);
     VnlMatrixFromCvMat<mitk::ScalarType> _VnlMatrixFromCvMat( &rotMat, &vnlMat );
     _VnlMatrixFromCvMat.Update();
 
 
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> vnlMatFixed(vnlMat);
 
     this->SetRotation( vnlMatFixed );
   }
 
   //# getter
   mitk::NavigationData::Pointer Transform::GetNavigationData() const
   {
     return m_NavData;
   }
 
   mitk::Point3D Transform::GetTranslation() const
   {
     return m_NavData->GetPosition();
   }
 
   mitk::Point3D Transform::GetPosition() const
   {
     return m_NavData->GetPosition();
   }
 
   mitk::Quaternion Transform::GetOrientation() const
   {
     return m_NavData->GetOrientation();
   }
 
   void Transform::GetMatrix(vtkMatrix4x4* matrix) const
   {
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> vnlMat = this->GetMatrix();
     for(unsigned int i=0; i<vnlMat.rows(); ++i)
       for(unsigned int j=0; j<vnlMat.cols(); ++j)
         matrix->SetElement(i,j, vnlMat(i,j));
   }
 
   void Transform::GetVtkOpenGlMatrix(vtkMatrix4x4* matrix) const
   {
     vnl_matrix<mitk::ScalarType> vnlRotation
         = this->GetVnlRotationMatrix().as_matrix();
 
     // normalize rows of rotation matrix
     vnlRotation.normalize_rows();
 
     vnl_matrix<mitk::ScalarType> vnlInverseRotation(3,3);
     // invert rotation
     vnlInverseRotation = vnl_matrix_inverse<mitk::ScalarType>(vnlRotation);
 
     vnl_vector<mitk::ScalarType> vnlTranslation
         = this->GetPosition().GetVnlVector();
     // rotate translation vector by inverse rotation P = P'
     vnlTranslation = vnlInverseRotation * vnlTranslation;
     vnlTranslation *= -1;  // save -P'
 
     // set position
     mitk::Transform::Pointer tmp = mitk::Transform::New();
 
     tmp->SetTranslation( vnlTranslation );
     tmp->SetRotation( vnlRotation );
     tmp->GetMatrix(matrix);
   }
 
   mitk::Point3D Transform::TransformPoint(mitk::Point3D point) const
   {
       itk::Matrix<mitk::ScalarType,3,3> R(GetVnlRotationMatrix());
       itk::Point<mitk::ScalarType,3> pointR = (R * point);
       mitk::Point3D retPoint = pointR;
       retPoint[0] = pointR[0] + GetPosition()[0];
       retPoint[1] = pointR[1] + GetPosition()[1];
       retPoint[2] = pointR[2] + GetPosition()[2];
       return retPoint;
   }
 
   //# cv getter
   cv::Mat Transform::GetCvTranslation() const
   {
     cv::Mat mat;
     vnl_vector<mitk::ScalarType> vec = this->GetVnlTranslation().as_vector();
     endodebugvar( vec )
     CvMatFromVnlVector<mitk::ScalarType> _CvMatFromVnlVector(&vec, &mat);
     _CvMatFromVnlVector.Update();
     return mat;
   }
 
   cv::Mat Transform::GetCvRotationMatrix() const
   {
     cv::Mat mat;
     vnl_matrix<mitk::ScalarType> vec = this->GetVnlRotationMatrix().as_matrix();
     endodebugvar( vec )
     CvMatFromVnlMatrix<mitk::ScalarType> _CvMatFromVnlMatrix(&vec, &mat);
     _CvMatFromVnlMatrix.Update();
     return mat;
   }
 
   cv::Mat Transform::GetCvMatrix() const
   {
     cv::Mat mat;
     vnl_matrix<mitk::ScalarType> vec = this->GetMatrix().as_matrix();
     CvMatFromVnlMatrix<mitk::ScalarType> _CvMatFromVnlMatrix(&vec, &mat);
     _CvMatFromVnlMatrix.Update();
     return mat;
   }
 
   cv::Mat Transform::GetCvRotationVector() const
   {
     cv::Mat rotVec(3,1,cv::DataType<mitk::ScalarType>::type);
     cv::Rodrigues( this->GetCvRotationMatrix(), rotVec );
     return rotVec;
   }
 
   //# vnl getter
   vnl_vector_fixed<mitk::ScalarType, 3> Transform::GetVnlTranslation() const
   {
     vnl_vector_fixed<mitk::ScalarType, 3> vec(m_NavData->GetPosition()
                                               .GetVnlVector());
     return vec;
   }
 
   vnl_matrix_fixed<mitk::ScalarType, 3, 3> Transform::GetVnlRotationMatrix() const
   {
     return m_NavData->GetOrientation().rotation_matrix_transpose();
   }
 
   vnl_matrix_fixed<double, 4, 4> Transform::GetVnlDoubleMatrix() const
   {
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> mat = this->GetMatrix();
 
     vnl_matrix_fixed<double, 4, 4> doubleMat;
 
     for(unsigned int i=0; i<mat.rows(); ++i)
       for(unsigned int j=0; j<mat.cols(); ++j)
         doubleMat(i,j) = static_cast<double>( mat(i,j) );
 
     return doubleMat;
   }
 
   vnl_matrix_fixed<mitk::ScalarType, 4, 4> Transform::GetMatrix()
       const
   {
     vnl_vector_fixed<mitk::ScalarType, 3> transl = this->GetVnlTranslation();
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> rot = this->GetVnlRotationMatrix();
 
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> homMat;
     homMat.set_identity();
     //std::cout << homMat << std::endl;
     for(unsigned int i=0; i<rot.rows(); ++i)
       for(unsigned int j=0; j<rot.cols(); ++j)
         homMat(i,j) = rot(i,j);
     for(unsigned int i=0; i<transl.size(); ++i)
       homMat(i,3) = transl[i];
 
     return homMat;
   }
 
   void Transform::TransposeRotation()
   {
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> rotMat = this->GetVnlRotationMatrix().transpose();
     this->SetRotation( rotMat );
   }
 
   void Transform::SetValid( bool valid )
   {
     if( m_NavData->IsDataValid() == valid )
       return;
 
     m_NavData->SetDataValid( valid );
     this->Modified();
   }
 
   std::string mitk::Transform::ToString() const
   {
     std::ostringstream s; s.precision(12);
 
     mitk::NavigationData::PositionType position;
     position.Fill(0.0);
     position = m_NavData->GetPosition();
 
     mitk::NavigationData::OrientationType orientation(0.0, 0.0, 0.0, 0.0);
     orientation = m_NavData->GetOrientation();
 
     s << "Translation: [" << position[0] << ", " << position[1] << ", "
         << position[2] << "]";
     s << ", orientation: [" << orientation[0] << ", " << orientation[1] << ", "
         << orientation[2] << ", " << orientation[3] << "]";
     s << ", valid: [" << (this->IsValid()? "true": "false") << "]";
 
     return s.str();
   }
 
-  void mitk::Transform::ToXML(TiXmlElement* elem) const
+  void mitk::Transform::ToXML(tinyxml2::XMLElement* elem) const
   {
-    std::string value = elem->ValueStr();
+    std::string value = elem->Value() != nullptr ? elem->Value() : "";
     if(value.empty())
       elem->SetValue(this->GetNameOfClass());
 
     mitk::NavigationData::PositionType position;
     position.Fill(0.0);
     position = m_NavData->GetPosition();
 
     mitk::NavigationData::OrientationType orientation(0.0, 0.0, 0.0, 0.0);
     orientation = m_NavData->GetOrientation();
 
     mitk::NavigationData::CovarianceMatrixType matrix;
     matrix.SetIdentity();
     matrix = m_NavData->GetCovErrorMatrix();
 
     bool hasPosition = true;
     hasPosition = m_NavData->GetHasPosition();
     bool hasOrientation = true;
     hasOrientation = m_NavData->GetHasOrientation();
     bool dataValid = false;
     dataValid = m_NavData->IsDataValid();
     mitk::NavigationData::TimeStampType timestamp=0.0;
 
-    elem->SetAttribute("Type", m_Type);
-    elem->SetDoubleAttribute("Time", timestamp);
-    elem->SetDoubleAttribute("X", position[0]);
-    elem->SetDoubleAttribute("Y", position[1]);
-    elem->SetDoubleAttribute("Z", position[2]);
-
-    elem->SetDoubleAttribute("QX", orientation[0]);
-    elem->SetDoubleAttribute("QY", orientation[1]);
-    elem->SetDoubleAttribute("QZ", orientation[2]);
-    elem->SetDoubleAttribute("QR", orientation[3]);
-
-    elem->SetDoubleAttribute("C00", matrix[0][0]);
-    elem->SetDoubleAttribute("C01", matrix[0][1]);
-    elem->SetDoubleAttribute("C02", matrix[0][2]);
-    elem->SetDoubleAttribute("C03", matrix[0][3]);
-    elem->SetDoubleAttribute("C04", matrix[0][4]);
-    elem->SetDoubleAttribute("C05", matrix[0][5]);
-    elem->SetDoubleAttribute("C10", matrix[1][0]);
-    elem->SetDoubleAttribute("C11", matrix[1][1]);
-    elem->SetDoubleAttribute("C12", matrix[1][2]);
-    elem->SetDoubleAttribute("C13", matrix[1][3]);
-    elem->SetDoubleAttribute("C14", matrix[1][4]);
-    elem->SetDoubleAttribute("C15", matrix[1][5]);
+    elem->SetAttribute("Type", m_Type.c_str());
+    elem->SetAttribute("Time", timestamp);
+    elem->SetAttribute("X", position[0]);
+    elem->SetAttribute("Y", position[1]);
+    elem->SetAttribute("Z", position[2]);
+
+    elem->SetAttribute("QX", orientation[0]);
+    elem->SetAttribute("QY", orientation[1]);
+    elem->SetAttribute("QZ", orientation[2]);
+    elem->SetAttribute("QR", orientation[3]);
+
+    elem->SetAttribute("C00", matrix[0][0]);
+    elem->SetAttribute("C01", matrix[0][1]);
+    elem->SetAttribute("C02", matrix[0][2]);
+    elem->SetAttribute("C03", matrix[0][3]);
+    elem->SetAttribute("C04", matrix[0][4]);
+    elem->SetAttribute("C05", matrix[0][5]);
+    elem->SetAttribute("C10", matrix[1][0]);
+    elem->SetAttribute("C11", matrix[1][1]);
+    elem->SetAttribute("C12", matrix[1][2]);
+    elem->SetAttribute("C13", matrix[1][3]);
+    elem->SetAttribute("C14", matrix[1][4]);
+    elem->SetAttribute("C15", matrix[1][5]);
 
     if (dataValid)
       elem->SetAttribute("Valid",1);
     else
       elem->SetAttribute("Valid",0);
 
     if (hasOrientation)
       elem->SetAttribute("hO",1);
     else
       elem->SetAttribute("hO",0);
 
     if (hasPosition)
       elem->SetAttribute("hP",1);
     else
       elem->SetAttribute("hP",0);
   }
 
-  void mitk::Transform::FromXML(TiXmlElement* elem)
+  void mitk::Transform::FromXML(const tinyxml2::XMLElement* elem)
   {
     assert(elem);
 
     mitk::NavigationData::Pointer nd = mitk::NavigationData::New();
     mitk::NavigationData::PositionType position;
     mitk::NavigationData::OrientationType orientation(0.0,0.0,0.0,0.0);
     mitk::NavigationData::TimeStampType timestamp = -1;
     mitk::NavigationData::CovarianceMatrixType matrix;
 
     bool hasPosition = true;
     bool hasOrientation = true;
     bool dataValid = false;
 
     position.Fill(0.0);
     matrix.SetIdentity();
 
-    std::string type = Transform::UNKNOWN_TYPE;
-    elem->QueryStringAttribute("Type", &type);
+    const char* typeC = elem->Attribute("Type");
+    std::string type = nullptr == typeC
+      ? Transform::UNKNOWN_TYPE
+      : typeC;
+
     elem->QueryDoubleAttribute("Time",&timestamp);
 
     // position and orientation is mandatory!
-    if(elem->QueryDoubleAttribute("X", &position[0]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("X", &position[0]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No X position found in xml");
-    if(elem->QueryDoubleAttribute("Y", &position[1]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("Y", &position[1]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No Y position found in xml");
-    if(elem->QueryDoubleAttribute("Z", &position[2]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("Z", &position[2]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No Z position found in xml");
 
-    if(elem->QueryDoubleAttribute("QX", &orientation[0]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("QX", &orientation[0]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No QX orientation found in xml");
-    if(elem->QueryDoubleAttribute("QY", &orientation[1]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("QY", &orientation[1]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No QY orientation found in xml");
-    if(elem->QueryDoubleAttribute("QZ", &orientation[2]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("QZ", &orientation[2]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No QZ orientation found in xml");
-    if(elem->QueryDoubleAttribute("QR", &orientation[3]) != TIXML_SUCCESS)
+    if(elem->QueryDoubleAttribute("QR", &orientation[3]) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("No QR orientation found in xml");
 
     elem->QueryDoubleAttribute("C00", &matrix[0][0]);
     elem->QueryDoubleAttribute("C01", &matrix[0][1]);
     elem->QueryDoubleAttribute("C02", &matrix[0][2]);
     elem->QueryDoubleAttribute("C03", &matrix[0][3]);
     elem->QueryDoubleAttribute("C04", &matrix[0][4]);
     elem->QueryDoubleAttribute("C05", &matrix[0][5]);
     elem->QueryDoubleAttribute("C10", &matrix[1][0]);
     elem->QueryDoubleAttribute("C11", &matrix[1][1]);
     elem->QueryDoubleAttribute("C12", &matrix[1][2]);
     elem->QueryDoubleAttribute("C13", &matrix[1][3]);
     elem->QueryDoubleAttribute("C14", &matrix[1][4]);
     elem->QueryDoubleAttribute("C15", &matrix[1][5]);
 
     int tmpval = 0;
     elem->QueryIntAttribute("Valid", &tmpval);
     if (tmpval == 0)
       dataValid = false;
     else
       dataValid = true;
 
     tmpval = 0;
     elem->QueryIntAttribute("hO", &tmpval);
     if (tmpval == 0)
       hasOrientation = false;
     else
       hasOrientation = true;
 
     tmpval = 0;
     elem->QueryIntAttribute("hP", &tmpval);
     if (tmpval == 0)
       hasPosition = false;
     else
       hasPosition = true;
 
     nd->SetIGTTimeStamp(timestamp);
     nd->SetPosition(position);
     nd->SetOrientation(orientation);
     nd->SetCovErrorMatrix(matrix);
     nd->SetDataValid(dataValid);
     nd->SetHasOrientation(hasOrientation);
     nd->SetHasPosition(hasPosition);
 
     m_NavData = nd;
     m_Type = type;
 
     this->Modified();
   }
 
 } // namespace mitk
 
 std::ostream& operator<< (std::ostream& os, mitk::Transform::Pointer p)
 {
   os << p->ToString();
   return os;
 }
diff --git a/Modules/CameraCalibration/mitkTransform.h b/Modules/CameraCalibration/mitkTransform.h
index 233abbc5b2..7aeabdd4b5 100644
--- a/Modules/CameraCalibration/mitkTransform.h
+++ b/Modules/CameraCalibration/mitkTransform.h
@@ -1,301 +1,300 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #ifndef MITKTRANSFORM_H
 #define MITKTRANSFORM_H
 
 #include <itkObject.h>
 #include <opencv2/calib3d.hpp>
 #include <mitkCommon.h>
 #include <mitkNumericTypes.h>
 #include <mitkNavigationData.h>
-#include <tinyxml.h>
 #include <sstream>
 #include <vtkMatrix4x4.h>
 #include <mitkXMLSerializable.h>
 #include <MitkCameraCalibrationExports.h>
 
 namespace mitk {
 
   ///
   /// \brief class representing a transfrom in 3D
   ///
   /// internally it stores a mitk navigation data. this is more
   /// or less a wrapper for navigation data for easy casting
   /// between opencv/vnl/mitk/xml representations of transform
   /// data
   ///
   class MITKCAMERACALIBRATION_EXPORT Transform: public itk::Object,
     public XMLSerializable
   {
   public:
     mitkClassMacroItkParent(Transform, itk::Object);
     itkFactorylessNewMacro(Transform);
     mitkNewMacro1Param(Transform, const mitk::NavigationData*);
     mitkNewMacro1Param(Transform, const std::string&);
 
     ///
     /// constants describing the type of transform
     /// represented here
     ///
     static const std::string UNKNOWN_TYPE;
     static const std::string ENDOSCOPE_SCOPE_TOOL;
     static const std::string ENDOSCOPE_CAM_TOOL;
     static const std::string CHESSBOARD_TOOL;
     static const std::string POINTER_TOOL;
     static const std::string POINTER_TO_CHESSBOARD_ORIGIN;
     static const std::string POINTER_TO_CHESSBOARD_X_SUPPORT_POINT;
     static const std::string POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT;
     static const std::string BOARD_TO_BOARD_TOOL;
     static const std::string REFERENCE_CAMERA_TRANSFORM;
     static const std::string REFERENCE_SCOPE_TRANSFORM;
     static const std::string EYE_TO_HAND_TRANSFORM;
     static const std::string CAMERA_EXTRINSICS;
 
     itkGetConstMacro(Type, std::string);
     itkSetMacro(Type, std::string&);
     ///
     /// Copies the content of transform to this
     /// instance
     ///
     void Copy( const mitk::Transform* transform );
 
     ///
     /// Copies the content of transform to this
     /// instance
     ///
     void Copy( const mitk::NavigationData* transform );
 
     ///
     /// Inverts the rotation of this transform
     /// (Polaris navigation Data have inverted rotation
     /// so you may want to call this function when using
     /// polaris data)
     ///
     void TransposeRotation();
 
     ///
     /// get a copy of this transform
     ///
     mitk::Transform::Pointer Clone() const;
 
     ///
     /// concatenate this transform with the given one,
     /// i.e. this transform is done first, then transform
     /// ( if x is this transform, y is transform, then this will be y*x)
     /// post multiply semantics!
     /// \see vtkTransform
     ///
     void Concatenate( mitk::Transform* transform );
     ///
     /// same as above with vnl mat argument
     ///
     void Concatenate( const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& transform );
 
     ///
     /// same as above with vtk mat argument
     ///
     void Concatenate( const vtkMatrix4x4* transform );
 
     ///
     /// invert this transform
     ///
     void Invert();
     ///
     /// resets the internal variables except type
     ///
     void Reset();
 
     ///
     /// read from xml
     ///
-    void FromXML(TiXmlElement* elem) override;
+    void FromXML(const tinyxml2::XMLElement* elem) override;
     ///
     /// read csv file
     ///
     void FromCSVFile(const std::string& file);
     ///
     /// grafts the data from naviData to this transform
     ///
     void SetNavigationData( const mitk::NavigationData* naviData );
     ///
     /// method to set orientation quat
     ///
     void SetOrientation( const vnl_quaternion<mitk::ScalarType>& orientation);
     ///
     /// method to set float valued orientation quat
     ///
     void SetOrientation( const vnl_quaternion<float>& orientation);
     ///
     /// method to set translation
     ///
     void SetTranslation( const vnl_vector_fixed<mitk::ScalarType, 3>& transl);
     ///
     /// method to set a vector of doubles as translation
     ///
     void SetTranslation( const vnl_vector<double>& transl);
     ///
     /// method to set a mitk::Point3D as position
     ///
     void SetPosition( const mitk::Point3D& transl);
     ///
     /// sets rotation with a rotation matrix
     ///
     void SetRotation( vnl_matrix_fixed<mitk::ScalarType, 3, 3>& mat);
     ///
     /// sets rotation with a non fixed rotation matrix
     ///
     void SetRotation( vnl_matrix<mitk::ScalarType>& mat);
     ///
     /// sets rotation and translation with a transformation matrix
     ///
     void SetMatrix( const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& mat);
     ///
     /// sets rotation and translation with a vtk transformation matrix
     ///
     void SetMatrix( const vtkMatrix4x4* mat);
     ///
     /// sets translation from a POD vector
     ///
     void SetTranslation( float* array );
     ///
     /// sets translation from a POD vector. this must be a
     /// 3x3=9 sized vector in row major format (first row = first
     /// three elements)
     ///
     void SetRotation( float* array );
     ///
     /// sets translation from a POD vector
     ///
     void SetTranslation( double array[3] );
     ///
     /// sets translation from a POD vector
     ///
     void SetRotation( double array[3][3] );
 
     ///
     /// method to set translation by cv vector
     ///
     void SetTranslation( const cv::Mat& transl);
     ///
     /// sets rotation with a rotation matrix
     ///
     void SetRotation( const cv::Mat& mat );
     ///
     /// sets rotation with a rodrigues rotation vector
     ///
     void SetRotationVector( const cv::Mat& rotVec);
 
     ///
     /// \return the navigation data that stores all information
     ///
     mitk::NavigationData::Pointer GetNavigationData() const;
     ///
     /// calls navigationdata::GetPosition()
     ///
     mitk::Point3D GetPosition() const;
     ///
     /// same as GetPosition
     ///
     mitk::Point3D GetTranslation() const;
     ///
     /// calls navigationdata::IsValid()
     ///
     bool IsValid() const;
     ///
     /// calls navigationdata::SetValid()
     ///
     void SetValid(bool valid);
 
     ///
     /// calls navigationdata::GetOrientation()
     ///
     mitk::Quaternion GetOrientation() const;
 
     ///
     /// \return the homogeneous matrix representing this transform
     ///
     vnl_matrix_fixed<mitk::ScalarType, 4, 4> GetMatrix() const;
     ///
     /// \return the homogeneous vtk matrix representing this transform
     ///
     void GetMatrix(vtkMatrix4x4* matrix) const;
     ///
     /// \return the homogeneous vtk matrix representing this transform
     /// in !OpenGL! left handed coordinate system
     ///
     void GetVtkOpenGlMatrix(vtkMatrix4x4* matrix) const;
 
     mitk::Point3D TransformPoint(mitk::Point3D point) const;
 
     ///
     /// create xml representation
     ///
-    void ToXML(TiXmlElement* elem) const override;
+    void ToXML(tinyxml2::XMLElement* elem) const override;
     ///
     /// create string representation
     ///
     std::string ToString() const;
     ///
     /// create string csv representation (only the transformation values!!!!)
     ///
     std::string ToCSVString() const;
     ///
     /// create matlab representation
     ///
     std::string ToMatlabString(const std::string& varname="transform",
                                bool printLastRow=true) const;
     ///
     /// write csv representation to file (only the transformation values!!!!)
     ///
     void ToCSVFile(const std::string& file) const;
     ///
     /// write matlab representation to file
     ///
     void ToMatlabFile(const std::string& file
                       , const std::string& varname="transform") const;
     ///
     /// conversion to cv types
     ///
     cv::Mat GetCvTranslation() const;
     cv::Mat GetCvRotationVector() const;
     cv::Mat GetCvRotationMatrix() const;
     cv::Mat GetCvMatrix() const;
 
     ///
     /// conversion to vnl types
     ///
     vnl_vector_fixed<mitk::ScalarType, 3> GetVnlTranslation() const;
     vnl_vector_fixed<double, 3> GetVnlDoubleTranslation() const;
     vnl_quaternion<double> GetVnlDoubleQuaternion() const;
     vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlRotationMatrix() const;
     vnl_matrix_fixed<double, 4, 4> GetVnlDoubleMatrix() const;
 
   protected:
     Transform();
     Transform(const mitk::NavigationData* nd);
     Transform(const std::string& s);
 
     // everything is stored here
     mitk::NavigationData::Pointer m_NavData;
 
     ///
     /// saves the type of the transform (Default is UNKNOWN_TYPE)
     ///
     std::string m_Type;
 };
 
 } // namespace mitk
 
 MITKCAMERACALIBRATION_EXPORT std::ostream& operator<<
     (std::ostream& os, mitk::Transform::Pointer p);
 
 #endif // MITKTRANSFORM_H
diff --git a/Modules/CameraCalibration/mitkXMLSerializable.cpp b/Modules/CameraCalibration/mitkXMLSerializable.cpp
index 525f8456de..0479a46ab1 100644
--- a/Modules/CameraCalibration/mitkXMLSerializable.cpp
+++ b/Modules/CameraCalibration/mitkXMLSerializable.cpp
@@ -1,137 +1,137 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #include <mitkXMLSerializable.h>
 #include "mitkEndoDebug.h"
 #include "mitkEndoMacros.h"
 #include <itksys/SystemTools.hxx>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   const std::string XMLSerializable::FILE_REFERENCE_ATTRIBUTE_NAME = "fileRef";
   const std::string XMLSerializable::ROOT_NAME = "data";
 
   void mitk::XMLSerializable::ToXMLFile(const std::string& file
                                         , const std::string& elemName)
   {
-    TiXmlElement * rootElem=nullptr;
-    TiXmlElement * element=nullptr;
+    tinyxml2::XMLElement * rootElem=nullptr;
+    tinyxml2::XMLElement* element=nullptr;
 
     // determine element to write to
     std::string elementName = elemName;
     if(elementName.empty())
       elementName = this->GetNameOfClass();
 
-    TiXmlDocument doc( file.c_str() );
-    bool loadOkay = doc.LoadFile();
+    tinyxml2::XMLDocument doc;
     // if the document already exists ...
-    if(loadOkay)
+    if(tinyxml2::XML_SUCCESS == doc.LoadFile(file.c_str()))
     {
       // try to identify the XML element of this class as the root
       // or as the child of the root
       rootElem = doc.RootElement();
       endoAssertMsg( rootElem, "No root element found in " << file );
 
       // if root element represents this element remove the root
-      if( rootElem->ValueStr() == elementName )
+      if( std::string(rootElem->Value() != nullptr ? rootElem->Value() : "") == elementName )
       {
-        doc.RemoveChild(rootElem);
+        doc.DeleteChild(rootElem);
         rootElem = nullptr;
       }
       else
       {
         // if it is a child of the root remove it too
-        element = rootElem->FirstChildElement(elementName);
+        element = rootElem->FirstChildElement(elementName.c_str());
         if(element)
-          rootElem->RemoveChild(element);
+          rootElem->DeleteChild(element);
       }
     }
     else
     {
       // document did not exist, create new one with declration
-      auto  decl = new TiXmlDeclaration( "1.0", "", "" );
-      doc.LinkEndChild( decl );
+      doc.InsertEndChild( doc.NewDeclaration() );
     }
 
     m_XMLFileName = file;
 
     // create element (if the document already exists this element was removed)
-    element = new TiXmlElement( elementName );
+    element = doc.NewElement( elementName.c_str() );
     this->ToXML( element );
 
     // if we do not have a root element create a new one
     if(!rootElem)
-      rootElem = new TiXmlElement( ROOT_NAME );
+      rootElem = doc.NewElement( ROOT_NAME.c_str() );
     // add the element node as child
-    rootElem->LinkEndChild(element);
+    rootElem->InsertEndChild(element);
 
     // if no root element exists, add it now
     if(doc.RootElement() == nullptr)
-      doc.LinkEndChild( rootElem );
+      doc.InsertEndChild( rootElem );
 
-    if(!doc.SaveFile( file ))
+    if(tinyxml2::XML_SUCCESS != doc.SaveFile( file.c_str() ))
     {
       std::ostringstream s; s << "File " << file
           << " could not be written. Please check permissions.";
       throw std::logic_error(s.str());
     }
   }
 
   std::string mitk::XMLSerializable::GetXMLFileName() const
   {
     return m_XMLFileName;
   }
 
   void mitk::XMLSerializable::FromXMLFile(const std::string& file
                                           , const std::string& elemName)
   {
     endodebug( "Trying to read from " << file )
 
-    TiXmlDocument doc( file.c_str() );
-    bool loadOkay = doc.LoadFile();
-    if(!loadOkay)
+    tinyxml2::XMLDocument doc;
+    if(tinyxml2::XML_SUCCESS != doc.LoadFile(file.c_str()))
     {
       std::ostringstream s; s << "File " << file
           << " could not be loaded!";
       throw std::logic_error(s.str().c_str());
     }
 
     m_XMLFileName = file;
 
-    TiXmlElement* elem = doc.FirstChildElement();
+    auto* elem = doc.FirstChildElement();
     endoAssertMsg( elem, "No root element found" );
 
     // determine element to read from
     std::string elementName = elemName;
     if(elementName.empty())
       elementName = this->GetNameOfClass();
     // try again with the first element
     if(strcmp(elem->Value(), elementName.c_str()) != 0)
       elem = elem->FirstChildElement(elementName.c_str());
 
     endoAssertMsg( elem, "No child element \"" << elementName <<
                  "\" found in " << file );
 
     // if theres an attribute as file reference try to load the class
     // from that file
-    std::string filename;
-    if(elem->QueryStringAttribute(FILE_REFERENCE_ATTRIBUTE_NAME.c_str(), &filename)
-      == TIXML_SUCCESS)
+    const char* filenameC = elem->Attribute(FILE_REFERENCE_ATTRIBUTE_NAME.c_str());
+    std::string filename = nullptr != filenameC
+      ? filenameC
+      : "";
+    if(!filename.empty())
     {
       if( !itksys::SystemTools::FileIsFullPath(filename.c_str()) )
         filename = itksys::SystemTools::GetFilenamePath(file) + "/" + filename;
       this->FromXMLFile(filename);
       return; // exit!
     }
 
     this->FromXML( elem );
   }
 }
diff --git a/Modules/CameraCalibration/mitkXMLSerializable.h b/Modules/CameraCalibration/mitkXMLSerializable.h
index 31dc61d346..8c0d78ecb9 100644
--- a/Modules/CameraCalibration/mitkXMLSerializable.h
+++ b/Modules/CameraCalibration/mitkXMLSerializable.h
@@ -1,88 +1,92 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #ifndef MITKXMLSerializable_H
 #define MITKXMLSerializable_H
 
 #include <string>
-#include <tinyxml.h>
 #include <itkObject.h>
 #include <itkMacro.h>
 #include <MitkCameraCalibrationExports.h>
 
+namespace tinyxml2
+{
+  class XMLElement;
+}
+
 namespace mitk
 {
   ///
   /// \brief interface for all classes able to write themselves to XML files
   ///
   class MITKCAMERACALIBRATION_EXPORT XMLSerializable
   {
   public:
     ///
     /// value of the special tag for file references
     /// if this is attribute is found the class
     /// will be loaded from the file in the attributes value
     ///
     static const std::string FILE_REFERENCE_ATTRIBUTE_NAME;
     ///
     /// the name of the root node that is created when the element is saved
     ///
     static const std::string ROOT_NAME;
     ///
     /// the tag value will be equals to the class name (function
     /// implemented by the itkTypeMacro)
     ///
     virtual const char* GetNameOfClass() const = 0;
 
     ///
     /// write your values here to elem
     ///
-    virtual void ToXML(TiXmlElement* elem) const = 0;
+    virtual void ToXML(tinyxml2::XMLElement* elem) const = 0;
     ///
     /// read your values here from elem
     ///
-    virtual void FromXML(TiXmlElement* elem) = 0;
+    virtual void FromXML(const tinyxml2::XMLElement* elem) = 0;
 
     ///
     /// tries to write the xml data obtained in ToXML() to file
     ///
     virtual void ToXMLFile(const std::string& file
                            , const std::string& elemName="");
 
     ///
     /// loads the XML file and calls FromXML()
     /// takes the first child of the document
     /// if this root node value is not equal to GetNameOfClass()
     /// the method will try to find the first children of the root
     /// node with the value of GetNameOfClass()
     /// if elemName is not empty then this value will be used instead
     /// of GetNameOfClass()
     /// if this node is found it will check if an attribute named
     /// FILE_REFERENCE_ATTRIBUTE_NAME is found: in this case
     /// the method calls itself with this attributes value as parameter
     ///
     virtual void FromXMLFile(const std::string& file
                              , const std::string& elemName="");
 
     ///
     /// \see m_XMLFileName
     ///
     std::string GetXMLFileName() const;
 
   private:
     ///
     /// saves the xmlfile name set for this serializable ( in FromXMLFile() )
     ///
     std::string m_XMLFileName;
   };
 }
 
 #endif
diff --git a/Modules/Classification/CLUtilities/CMakeLists.txt b/Modules/Classification/CLUtilities/CMakeLists.txt
index 3c7f86a35d..0d441525b8 100644
--- a/Modules/Classification/CLUtilities/CMakeLists.txt
+++ b/Modules/Classification/CLUtilities/CMakeLists.txt
@@ -1,14 +1,14 @@
 mitk_create_module(
   DEPENDS MitkCore MitkCLCore MitkCommandLine MitkDICOM
-  PACKAGE_DEPENDS PUBLIC Eigen PRIVATE tinyxml VTK|FiltersStatistics
+  PACKAGE_DEPENDS PUBLIC Eigen PRIVATE tinyxml2|tinyxml2 VTK|FiltersStatistics
 )
 
 if(TARGET ${MODULE_TARGET})
   if(MITK_USE_OpenMP)
-    target_link_libraries(${MODULE_TARGET} PUBLIC OpenMP::OpenMP_CXX)
+    target_link_libraries(${MODULE_TARGET} PUBLIC OpenMP::OpenMP_CXX PRIVATE tinyxml2::tinyxml2)
   endif()
 
   if(BUILD_TESTING)
     add_subdirectory(test)
   endif()
 endif()
diff --git a/Modules/Classification/CLUtilities/src/mitkCLResultXMLWriter.cpp b/Modules/Classification/CLUtilities/src/mitkCLResultXMLWriter.cpp
index 0d3bf0c5ef..c884a41381 100644
--- a/Modules/Classification/CLUtilities/src/mitkCLResultXMLWriter.cpp
+++ b/Modules/Classification/CLUtilities/src/mitkCLResultXMLWriter.cpp
@@ -1,318 +1,321 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include <mitkCLResultXMLWriter.h>
 
 #include <iostream>
 #include <locale>
 #include <iomanip>
 #include <ctime>
 #include <sstream>
 
 #include <mitkDICOMTagPath.h>
 #include <mitkDICOMProperty.h>
 #include <mitkLocaleSwitch.h>
 #include <mitkIOMetaInformationPropertyConstants.h>
 #include <mitkDICOMIOMetaInformationPropertyConstants.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 template <class charT>
 class punct_facet : public std::numpunct<charT> {
 public:
   punct_facet(charT sep) :
     m_Sep(sep)
   {
 
   }
 protected:
   charT do_decimal_point() const override { return m_Sep; }
 private:
   charT m_Sep;
 };
 
-void AddPropertyAsNode(const mitk::Image* image, const std::string& key, const std::string& tag, TiXmlElement* rootNode)
+void AddPropertyAsNode(const mitk::Image* image, const std::string& key, const std::string& tag, tinyxml2::XMLElement* rootNode)
 {
   auto prop = image->GetProperty(key.c_str());
   if (prop.IsNotNull())
   {
-    auto propNode = new TiXmlElement(tag);
-    TiXmlText* valueText = new TiXmlText(prop->GetValueAsString());
-    propNode->LinkEndChild(valueText);
+    auto* doc = rootNode->GetDocument();
+    auto propNode = doc->NewElement(tag.c_str());
+    auto* valueText = doc->NewText(prop->GetValueAsString().c_str());
+    propNode->InsertEndChild(valueText);
 
-    rootNode->LinkEndChild(propNode);
+    rootNode->InsertEndChild(propNode);
   }
 }
 
-void AddSeriesInstanceUID(const mitk::Image* image, TiXmlElement* xmlNode)
+void AddSeriesInstanceUID(const mitk::Image* image, tinyxml2::XMLElement* xmlNode)
 {
   AddPropertyAsNode(image, mitk::DICOMTagPathToPropertyName(mitk::DICOMTagPath(0x0020, 0x000e)), "mp:seriesInstanceUID", xmlNode);
 }
 
-void AddFilePath(const mitk::Image* image, TiXmlElement* xmlNode)
+void AddFilePath(const mitk::Image* image, tinyxml2::XMLElement* xmlNode)
 {
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::IOMetaInformationPropertyConstants::READER_INPUTLOCATION()), "mp:filePath", xmlNode);
 }
 
-void AddSOPInstanceUIDs(const mitk::Image* image, TiXmlElement* xmlNode)
+void AddSOPInstanceUIDs(const mitk::Image* image, tinyxml2::XMLElement* xmlNode)
 {
   auto prop = image->GetProperty(mitk::DICOMTagPathToPropertyName(mitk::DICOMTagPath(0x0008, 0x0018)).c_str());
   auto dicomProp = dynamic_cast<const mitk::DICOMProperty*>(prop.GetPointer());
+  auto* doc = xmlNode->GetDocument();
   if (dicomProp != nullptr)
   {
-    auto instanceUIDsNode = new TiXmlElement("mp:sopInstanceUIDs");
-    xmlNode->LinkEndChild(instanceUIDsNode);
+    auto* instanceUIDsNode = doc->NewElement("mp:sopInstanceUIDs");
+    xmlNode->InsertEndChild(instanceUIDsNode);
 
     if (dicomProp->IsUniform())
     {
-      auto instanceUIDNode = new TiXmlElement("mp:sopInstanceUID");
-      TiXmlText* valueText = new TiXmlText(dicomProp->GetValueAsString());
-      instanceUIDNode->LinkEndChild(valueText);
-      instanceUIDsNode->LinkEndChild(instanceUIDNode);
+      auto* instanceUIDNode = doc->NewElement("mp:sopInstanceUID");
+      auto* valueText = doc->NewText(dicomProp->GetValueAsString().c_str());
+      instanceUIDNode->InsertEndChild(valueText);
+      instanceUIDsNode->InsertEndChild(instanceUIDNode);
     }
     else
     {
       const auto timeSteps = dicomProp->GetAvailableTimeSteps();
       for (auto timeStep : timeSteps)
       {
         const auto slices = dicomProp->GetAvailableSlices(timeStep);
         for (auto slice : slices)
         {
-          auto instanceUIDNode = new TiXmlElement("mp:sopInstanceUID");
-          instanceUIDNode->SetAttribute("z", slice);
-          instanceUIDNode->SetAttribute("t", timeStep);
-          TiXmlText* valueText = new TiXmlText(dicomProp->GetValue(timeStep, slice));
-          instanceUIDNode->LinkEndChild(valueText);
-          instanceUIDsNode->LinkEndChild(instanceUIDNode);
+          auto instanceUIDNode = doc->NewElement("mp:sopInstanceUID");
+          instanceUIDNode->SetAttribute("z", static_cast<int>(slice));
+          instanceUIDNode->SetAttribute("t", static_cast<int>(timeStep));
+          auto* valueText = doc->NewText(dicomProp->GetValue(timeStep, slice).c_str());
+          instanceUIDNode->InsertEndChild(valueText);
+          instanceUIDsNode->InsertEndChild(instanceUIDNode);
         }
       }
     }
   }
 }
 
-void AddDateAndTime(TiXmlElement* rootNode)
+void AddDateAndTime(tinyxml2::XMLElement* rootNode)
 {
-  auto dateNode = new TiXmlElement("mp:generationDate");
+  auto* doc = rootNode->GetDocument();
+  auto* dateNode = doc->NewElement("mp:generationDate");
   auto time = std::time(nullptr);
   std::ostringstream sstream;
   sstream << std::put_time(std::localtime(&time), "%Y%m%d");
-  TiXmlText* valueText = new TiXmlText(sstream.str());
-  dateNode->LinkEndChild(valueText);
+  auto* valueText = doc->NewText(sstream.str().c_str());
+  dateNode->InsertEndChild(valueText);
 
-  rootNode->LinkEndChild(dateNode);
+  rootNode->InsertEndChild(dateNode);
 
-  auto timeNode = new TiXmlElement("mp:generationTime");
+  auto* timeNode = doc->NewElement("mp:generationTime");
   std::ostringstream timestream;
   timestream << std::put_time(std::localtime(&time), "%H%M%S");
-  valueText = new TiXmlText(timestream.str());
-  timeNode->LinkEndChild(valueText);
+  valueText = doc->NewText(timestream.str().c_str());
+  timeNode->InsertEndChild(valueText);
 
-  rootNode->LinkEndChild(timeNode);
+  rootNode->InsertEndChild(timeNode);
 }
 
-void AddParameters(const std::map<std::string, us::Any>& parameters, TiXmlElement* paramsNode)
+void AddParameters(const std::map<std::string, us::Any>& parameters, tinyxml2::XMLElement* paramsNode)
 {
+  auto* doc = paramsNode->GetDocument();
   for (const auto& param : parameters)
   {
     mitk::LocaleSwitch lswitch("C");
-    auto paramNode = new TiXmlElement("mp:parameter");
-    paramNode->SetAttribute("name", param.first);
-    TiXmlText* valueText = new TiXmlText(param.second.ToString());
-    paramNode->LinkEndChild(valueText);
-    paramsNode->LinkEndChild(paramNode);
+    auto paramNode = doc->NewElement("mp:parameter");
+    paramNode->SetAttribute("name", param.first.c_str());
+    auto* valueText = doc->NewText(param.second.ToString().c_str());
+    paramNode->InsertEndChild(valueText);
+    paramsNode->InsertEndChild(paramNode);
   }
 }
 
-void AddFeatures(const mitk::AbstractGlobalImageFeature::FeatureListType& features, TiXmlElement* featsNode)
+void AddFeatures(const mitk::AbstractGlobalImageFeature::FeatureListType& features, tinyxml2::XMLElement* featsNode)
 {
+  auto* doc = featsNode->GetDocument();
   for (const auto& feat : features)
   {
-    auto featNode = new TiXmlElement("mp:feature");
-    featNode->SetAttribute("name", feat.first.name);
-    featNode->SetAttribute("version", feat.first.version);
-    featNode->SetAttribute("class", feat.first.featureClass);
-    featNode->SetAttribute("setting", feat.first.settingID);
+    auto featNode = doc->NewElement("mp:feature");
+    featNode->SetAttribute("name", feat.first.name.c_str());
+    featNode->SetAttribute("version", feat.first.version.c_str());
+    featNode->SetAttribute("class", feat.first.featureClass.c_str());
+    featNode->SetAttribute("setting", feat.first.settingID.c_str());
     std::ostringstream sstream;
     sstream.imbue(std::locale("C"));
     sstream << feat.second;
-    TiXmlText* valueText = new TiXmlText(sstream.str());
-    featNode->LinkEndChild(valueText);
-    featsNode->LinkEndChild(featNode);
+    auto* valueText = doc->NewText(sstream.str().c_str());
+    featNode->InsertEndChild(valueText);
+    featsNode->InsertEndChild(featNode);
   }
 }
 
-void AddFeatureSettings(const mitk::AbstractGlobalImageFeature::FeatureListType& features, TiXmlElement* featSettingsNode)
+void AddFeatureSettings(const mitk::AbstractGlobalImageFeature::FeatureListType& features, tinyxml2::XMLElement* featSettingsNode)
 {
+  auto* doc = featSettingsNode->GetDocument();
   std::list<std::string> coveredSettings;
   for (const auto& feat : features)
   {
     auto finding = std::find(coveredSettings.begin(), coveredSettings.end(), feat.first.settingID);
     if (finding == coveredSettings.end())
     {
-      auto featSettingNode = new TiXmlElement("mp:featureSetting");
-      featSettingsNode->LinkEndChild(featSettingNode);
-      featSettingNode->SetAttribute("name", feat.first.settingID);
+      auto featSettingNode = doc->NewElement("mp:featureSetting");
+      featSettingsNode->InsertEndChild(featSettingNode);
+      featSettingNode->SetAttribute("name", feat.first.settingID.c_str());
       AddParameters(feat.first.parameters, featSettingNode);
       coveredSettings.push_back(feat.first.settingID);
     }
   }
 }
 
-void AddReaderInfo(const mitk::Image* image, TiXmlElement* imageNode)
+void AddReaderInfo(const mitk::Image* image, tinyxml2::XMLElement* imageNode)
 {
-  auto ioNode = new TiXmlElement("mp:IOReader");
-  imageNode->LinkEndChild(ioNode);
+  auto* doc = imageNode->GetDocument();
+  auto ioNode = doc->NewElement("mp:IOReader");
+  imageNode->InsertEndChild(ioNode);
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::IOMetaInformationPropertyConstants::READER_DESCRIPTION()), "mp:description", ioNode);
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::IOMetaInformationPropertyConstants::READER_VERSION()), "mp:version", ioNode);
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::DICOMIOMetaInformationPropertyConstants::READER_CONFIGURATION()), "mp:configuration", ioNode);
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::DICOMIOMetaInformationPropertyConstants::READER_GDCM()), "mp:gdcmVersion", ioNode);
   AddPropertyAsNode(image, mitk::PropertyKeyPathToPropertyName(mitk::DICOMIOMetaInformationPropertyConstants::READER_DCMTK()), "mp:dcmtkVersion", ioNode);
 }
 
 void WriteDocument(std::ostream& stream, const mitk::Image* image, const mitk::Image* mask,
   const mitk::AbstractGlobalImageFeature::FeatureListType& features, const std::string& methodName,
   const std::string& organisation, const std::string& version, const std::string& pipelineUID,
   const std::map<std::string, us::Any>& cliArgs)
 {
-  TiXmlDocument doc;
-  doc.SetCondenseWhiteSpace(false);
+  tinyxml2::XMLDocument doc;
+  doc.InsertEndChild(doc.NewDeclaration());
 
-  auto decl = new TiXmlDeclaration(
-    "1.0", "UTF-8", "");
-  doc.LinkEndChild(decl);
-
-  auto rootNode = new TiXmlElement("mp:measurement");
+  auto* rootNode = doc.NewElement("mp:measurement");
   rootNode->SetAttribute("xmlns:mp", "http://www.mitk.org/Phenotyping");
-  doc.LinkEndChild(rootNode);
+  doc.InsertEndChild(rootNode);
 
-  auto methodNode = new TiXmlElement("mp:measurementMethod");
-  rootNode->LinkEndChild(methodNode);
+  auto* methodNode = doc.NewElement("mp:measurementMethod");
+  rootNode->InsertEndChild(methodNode);
 
-  auto methodNameNode = new TiXmlElement("mp:name");
-  TiXmlText* valueText = new TiXmlText(methodName);
-  methodNameNode->LinkEndChild(valueText);
-  methodNode->LinkEndChild(methodNameNode);
+  auto* methodNameNode = doc.NewElement("mp:name");
+  auto* valueText = doc.NewText(methodName.c_str());
+  methodNameNode->InsertEndChild(valueText);
+  methodNode->InsertEndChild(methodNameNode);
 
-  auto organisationNode = new TiXmlElement("mp:organisation");
-  valueText = new TiXmlText(organisation);
-  organisationNode->LinkEndChild(valueText);
-  methodNode->LinkEndChild(organisationNode);
+  auto* organisationNode = doc.NewElement("mp:organisation");
+  valueText = doc.NewText(organisation.c_str());
+  organisationNode->InsertEndChild(valueText);
+  methodNode->InsertEndChild(organisationNode);
 
-  auto versionNode = new TiXmlElement("mp:version");
-  valueText = new TiXmlText(version);
-  versionNode->LinkEndChild(valueText);
-  methodNode->LinkEndChild(versionNode);
+  auto* versionNode = doc.NewElement("mp:version");
+  valueText = doc.NewText(version.c_str());
+  versionNode->InsertEndChild(valueText);
+  methodNode->InsertEndChild(versionNode);
 
-  auto imageNode = new TiXmlElement("mp:image");
-  rootNode->LinkEndChild(imageNode);
+  auto* imageNode = doc.NewElement("mp:image");
+  rootNode->InsertEndChild(imageNode);
 
   AddSeriesInstanceUID(image, imageNode);
   AddFilePath(image, imageNode);
   AddSOPInstanceUIDs(image, imageNode);
   AddReaderInfo(image,imageNode);
 
 
-  auto maskNode = new TiXmlElement("mp:mask");
-  rootNode->LinkEndChild(maskNode);
+  auto* maskNode = doc.NewElement("mp:mask");
+  rootNode->InsertEndChild(maskNode);
 
   AddSeriesInstanceUID(mask, maskNode);
   AddFilePath(mask, maskNode);
   AddSOPInstanceUIDs(mask, maskNode);
   AddReaderInfo(mask, maskNode);
 
   //todo mask reader meta info
 
   AddDateAndTime(rootNode);
 
-  auto pipelineNode = new TiXmlElement("mp:pipelineUID");
-  valueText = new TiXmlText(pipelineUID);
-  pipelineNode->LinkEndChild(valueText);
-  rootNode->LinkEndChild(pipelineNode);
+  auto* pipelineNode = doc.NewElement("mp:pipelineUID");
+  valueText = doc.NewText(pipelineUID.c_str());
+  pipelineNode->InsertEndChild(valueText);
+  rootNode->InsertEndChild(pipelineNode);
 
-  auto paramsNode = new TiXmlElement("mp:parameters");
-  rootNode->LinkEndChild(paramsNode);
+  auto* paramsNode = doc.NewElement("mp:parameters");
+  rootNode->InsertEndChild(paramsNode);
   AddParameters(cliArgs, paramsNode);
 
-  auto featsNode = new TiXmlElement("mp:features");
-  rootNode->LinkEndChild(featsNode);
+  auto* featsNode = doc.NewElement("mp:features");
+  rootNode->InsertEndChild(featsNode);
 
   AddFeatures(features, featsNode);
 
-  auto featSettingsNode = new TiXmlElement("mp:featureSettings");
-  rootNode->LinkEndChild(featSettingsNode);
+  auto* featSettingsNode = doc.NewElement("mp:featureSettings");
+  rootNode->InsertEndChild(featSettingsNode);
   AddFeatureSettings(features, featSettingsNode);
 
-  TiXmlPrinter printer;
+  tinyxml2::XMLPrinter printer;
+  doc.Print(&printer);
 
-  doc.Accept(&printer);
-  stream << printer.Str();
+  stream << printer.CStr();
 }
 
 void mitk::cl::CLResultXMLWriter::SetImage(const Image* image)
 {
   m_Image = image;
 }
 
 void mitk::cl::CLResultXMLWriter::SetMask(const Image* mask)
 {
   m_Mask = mask;
 }
 
 void mitk::cl::CLResultXMLWriter::SetFeatures(const mitk::AbstractGlobalImageFeature::FeatureListType& features)
 {
   m_Features = features;
 }
 
 void mitk::cl::CLResultXMLWriter::SetMethodName(const std::string& name)
 {
   m_MethodName = name;
 }
 
 void mitk::cl::CLResultXMLWriter::SetMethodVersion(const std::string& version)
 {
   m_MethodVersion = version;
 }
 
 void mitk::cl::CLResultXMLWriter::SetOrganisation(const std::string& orga)
 {
   m_Organisation = orga;
 }
 
 void mitk::cl::CLResultXMLWriter::SetPipelineUID(const std::string& pipelineUID)
 {
   m_PipelineUID = pipelineUID;
 }
 
 void mitk::cl::CLResultXMLWriter::SetCLIArgs(const std::map<std::string, us::Any>& args)
 {
   m_CLIArgs = args;
 }
 
 void mitk::cl::CLResultXMLWriter::write(const std::string& filePath) const
 {
   std::ofstream resultFile;
   resultFile.open(filePath.c_str());
   if (resultFile.is_open())
   {
     this->write(resultFile);
     resultFile.close();
   }
   else
   {
     MITK_ERROR << "Cannot write xml results. Unable to open file: \""<<filePath<<"\"";
   }
 }
 
 void mitk::cl::CLResultXMLWriter::write(std::ostream& stream) const
 {
   WriteDocument(stream, m_Image, m_Mask, m_Features, m_MethodName, m_Organisation, m_MethodVersion, m_PipelineUID, m_CLIArgs);
 }
diff --git a/Modules/ContourModel/IO/mitkContourModelReader.cpp b/Modules/ContourModel/IO/mitkContourModelReader.cpp
index fa0ead2c5f..1b25342e91 100644
--- a/Modules/ContourModel/IO/mitkContourModelReader.cpp
+++ b/Modules/ContourModel/IO/mitkContourModelReader.cpp
@@ -1,157 +1,173 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkContourModelReader.h"
 #include <fstream>
 #include <iostream>
+#include <regex>
 #include <mitkCustomMimeType.h>
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
+
+namespace
+{
+  // Previous versions of the ContourModelSetWriter produced flawed
+  // XML files with multiple XML declarations.
+  std::string RemoveErroneousXMLDeclarations(const std::string& filename)
+  {
+    std::ifstream file(filename);
+    file.seekg(0, std::ios_base::end);
+    auto size = file.tellg();
+    std::string string(size, '\0');
+    file.seekg(0);
+    file.read(&string[0], size);
+    file.close();
+    std::regex regex("><\\?xml.+\\?>");
+    return std::regex_replace(string, regex, ">");
+  }
+}
 
 mitk::ContourModelReader::ContourModelReader(const mitk::ContourModelReader &other) : mitk::AbstractFileReader(other)
 {
 }
 
 mitk::ContourModelReader::ContourModelReader() : AbstractFileReader()
 {
   std::string category = "Contour File";
   mitk::CustomMimeType customMimeType;
   customMimeType.SetCategory(category);
   customMimeType.AddExtension("cnt");
 
   this->SetDescription(category);
   this->SetMimeType(customMimeType);
 
   m_ServiceReg = this->RegisterService();
 }
 
 mitk::ContourModelReader::~ContourModelReader()
 {
 }
 
 std::vector<itk::SmartPointer<mitk::BaseData>> mitk::ContourModelReader::DoRead()
 {
   std::vector<itk::SmartPointer<mitk::BaseData>> result;
   std::string location = GetInputLocation();
 
   // Switch the current locale to "C"
   LocaleSwitch localeSwitch("C");
 
   try
   {
-    TiXmlDocument doc(location.c_str());
-    bool loadOkay = doc.LoadFile();
-    if (loadOkay)
+    auto string = RemoveErroneousXMLDeclarations(location);
+
+    tinyxml2::XMLDocument doc;
+    if (tinyxml2::XML_SUCCESS == doc.Parse(string.c_str()))
     {
-      TiXmlHandle docHandle(&doc);
+      tinyxml2::XMLHandle docHandle(&doc);
 
       /*++++ handle n contourModels within data tags ++++*/
-      for (TiXmlElement *currentContourElement = docHandle.FirstChildElement("contourModel").ToElement();
+      for (auto *currentContourElement = docHandle.FirstChildElement("contourModel").ToElement();
            currentContourElement != nullptr;
            currentContourElement = currentContourElement->NextSiblingElement())
       {
         mitk::ContourModel::Pointer newContourModel = mitk::ContourModel::New();
         if (currentContourElement->FirstChildElement("data")->FirstChildElement("timestep") != nullptr)
         {
-          // handle geometry information
-          // TiXmlElement* currentGeometryInfo =
-          // currentContourElement->FirstChildElement("head")->FirstChildElement("geometryInformation")->ToElement();
-          ///////////// NOT SUPPORTED YET ////////////////
-
           /*++++ handle n timesteps within timestep tags ++++*/
-          for (TiXmlElement *currentTimeSeries =
+          for (auto *currentTimeSeries =
                  currentContourElement->FirstChildElement("data")->FirstChildElement("timestep")->ToElement();
                currentTimeSeries != nullptr;
                currentTimeSeries = currentTimeSeries->NextSiblingElement())
           {
             unsigned int currentTimeStep(0);
 
             currentTimeStep = atoi(currentTimeSeries->Attribute("n"));
 
             this->ReadPoints(newContourModel, currentTimeSeries, currentTimeStep);
 
             int isClosed;
             currentTimeSeries->QueryIntAttribute("isClosed", &isClosed);
             if (isClosed)
             {
               newContourModel->Close(currentTimeStep);
             }
           }
           /*++++ END handle n timesteps within timestep tags ++++*/
         }
         else
         {
           // this should not happen
           MITK_WARN << "wrong file format!";
           // newContourModel = this->ReadPoint(newContourModel, currentContourElement, 0);
         }
         newContourModel->UpdateOutputInformation();
         result.push_back(dynamic_cast<mitk::BaseData *>(newContourModel.GetPointer()));
       }
       /*++++ END handle n contourModels within data tags ++++*/
     }
     else
     {
       MITK_WARN << "XML parser error!";
     }
   }
   catch (...)
   {
     MITK_ERROR << "Cannot read contourModel.";
   }
 
   return result;
 }
 
 mitk::ContourModelReader *mitk::ContourModelReader::Clone() const
 {
   return new ContourModelReader(*this);
 }
 
 void mitk::ContourModelReader::ReadPoints(mitk::ContourModel::Pointer newContourModel,
-                                          TiXmlElement *currentTimeSeries,
+                                          const tinyxml2::XMLElement *currentTimeSeries,
                                           unsigned int currentTimeStep)
 {
   // check if the timesteps in contourModel have to be expanded
   if (currentTimeStep != newContourModel->GetTimeSteps())
   {
     newContourModel->Expand(currentTimeStep + 1);
   }
 
   // read all points within controlPoints tag
   if (currentTimeSeries->FirstChildElement("controlPoints")->FirstChildElement("point") != nullptr)
   {
-    for (TiXmlElement *currentPoint =
+    for (auto *currentPoint =
            currentTimeSeries->FirstChildElement("controlPoints")->FirstChildElement("point")->ToElement();
          currentPoint != nullptr;
          currentPoint = currentPoint->NextSiblingElement())
     {
       double x(0.0);
       double y(0.0);
       double z(0.0);
 
       x = atof(currentPoint->FirstChildElement("x")->GetText());
       y = atof(currentPoint->FirstChildElement("y")->GetText());
       z = atof(currentPoint->FirstChildElement("z")->GetText());
 
       int isActivePoint;
       currentPoint->QueryIntAttribute("isActive", &isActivePoint);
 
       mitk::Point3D point;
       mitk::FillVector3D(point, x, y, z);
       newContourModel->AddVertex(point, isActivePoint, currentTimeStep);
     }
   }
   else
   {
     // nothing to read
   }
 }
diff --git a/Modules/ContourModel/IO/mitkContourModelReader.h b/Modules/ContourModel/IO/mitkContourModelReader.h
index bbeae0a7ec..f91298ae2c 100644
--- a/Modules/ContourModel/IO/mitkContourModelReader.h
+++ b/Modules/ContourModel/IO/mitkContourModelReader.h
@@ -1,56 +1,60 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #ifndef _MITK_CONTOURMODEL_READER__H_
 #define _MITK_CONTOURMODEL_READER__H_
 
 // MITK
 #include <mitkAbstractFileReader.h>
 #include <mitkBaseData.h>
 #include <mitkContourModel.h>
 #include <mitkMimeType.h>
 
 #include <stack>
 #include <string>
-#include <tinyxml.h>
 #include <vtkXMLParser.h>
 
+namespace tinyxml2
+{
+  class XMLElement;
+}
+
 namespace mitk
 {
   /**
    * @brief
    * @ingroup MitkContourModelModule
   */
   class ContourModelReader : public mitk::AbstractFileReader
   {
   public:
     ContourModelReader(const ContourModelReader &other);
 
     ContourModelReader();
 
     ~ContourModelReader() override;
 
     using AbstractFileReader::Read;
 
   protected:
     virtual void ReadPoints(mitk::ContourModel::Pointer newContourModel,
-                            TiXmlElement *currentTimeSeries,
+                            const tinyxml2::XMLElement *currentTimeSeries,
                             unsigned int currentTimeStep);
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
   private:
     ContourModelReader *Clone() const override;
 
     us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
   };
 }
 
 #endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSetReader.h b/Modules/ContourModel/IO/mitkContourModelSetReader.h
index 91e24180a1..3472efff46 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetReader.h
+++ b/Modules/ContourModel/IO/mitkContourModelSetReader.h
@@ -1,54 +1,53 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #ifndef _MITK_ContourModelSetReader__H_
 #define _MITK_ContourModelSetReader__H_
 
 // MITK
 #include <mitkAbstractFileReader.h>
 #include <mitkBaseData.h>
 #include <mitkContourModel.h>
 #include <mitkContourModelSet.h>
 #include <mitkMimeType.h>
 
 #include <stack>
 #include <string>
-#include <tinyxml.h>
 #include <vtkXMLParser.h>
 
 namespace mitk
 {
   /**
    * @brief
    * @ingroup MitkContourModelModule
   */
   class ContourModelSetReader : public mitk::AbstractFileReader
   {
   public:
     ContourModelSetReader(const ContourModelSetReader &other);
 
     ContourModelSetReader();
 
     ~ContourModelSetReader() override;
 
     using AbstractFileReader::Read;
 
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
   private:
     ContourModelSetReader *Clone() const override;
 
     us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
   };
 }
 
 #endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSetWriter.cpp b/Modules/ContourModel/IO/mitkContourModelSetWriter.cpp
index c437dd022b..deb595a399 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetWriter.cpp
+++ b/Modules/ContourModel/IO/mitkContourModelSetWriter.cpp
@@ -1,82 +1,85 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkContourModelSetWriter.h"
 #include "mitkContourModelWriter.h"
 #include <fstream>
 #include <iostream>
 #include <mitkCustomMimeType.h>
 
 mitk::ContourModelSetWriter::ContourModelSetWriter() : AbstractFileWriter(ContourModelSet::GetStaticNameOfClass())
 {
   std::string category = "ContourModelSet File";
   mitk::CustomMimeType customMimeType;
   customMimeType.SetCategory(category);
   customMimeType.AddExtension("cnt_set");
 
   this->SetDescription(category);
   this->SetMimeType(customMimeType);
 
   RegisterService();
 }
 
 mitk::ContourModelSetWriter::ContourModelSetWriter(const mitk::ContourModelSetWriter &other) : AbstractFileWriter(other)
 {
 }
 
 mitk::ContourModelSetWriter::~ContourModelSetWriter()
 {
 }
 
 void mitk::ContourModelSetWriter::Write()
 {
   std::ostream *out;
   std::ofstream outStream;
 
   if (this->GetOutputStream())
   {
     out = this->GetOutputStream();
   }
   else
   {
     outStream.open(this->GetOutputLocation().c_str());
     out = &outStream;
   }
 
   if (!out->good())
   {
     mitkThrow() << "Stream not good.";
   }
 
+  *out << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
+
   // Use regular ContourModel writer to write each contour of the set to a single file.
   // Just use a different file extension .cnt_set
 
-  mitk::ContourModelWriter writer;
+  bool writeXMLHeader = false;
+  mitk::ContourModelWriter writer(writeXMLHeader);
 
   mitk::ContourModelSet::ConstPointer contourModelSet = dynamic_cast<const mitk::ContourModelSet *>(this->GetInput());
 
   //
   // for each contour object set input of writer
   //
   for (int i = 0; i < contourModelSet->GetSize(); ++i)
   {
     const mitk::ContourModel *contour = contourModelSet->GetContourModelAt(i);
     writer.SetInput(contour);
     writer.SetOutputStream(this->GetOutputLocation(), out);
     writer.Write();
   }
 }
 
 mitk::ContourModelSetWriter *mitk::ContourModelSetWriter::Clone() const
 {
   return new ContourModelSetWriter(*this);
 }
diff --git a/Modules/ContourModel/IO/mitkContourModelWriter.cpp b/Modules/ContourModel/IO/mitkContourModelWriter.cpp
index f41a1d83f4..8e7710a626 100644
--- a/Modules/ContourModel/IO/mitkContourModelWriter.cpp
+++ b/Modules/ContourModel/IO/mitkContourModelWriter.cpp
@@ -1,335 +1,335 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkContourModelWriter.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkTimeGeometry.h"
 #include <fstream>
 #include <iostream>
 #include <locale>
 
 /*
  * The xml file will look like:
  *
  *   <?xml version="1.0" encoding="utf-8"?>
  *   <contourModel>
  *      <head>
  *        <geometryInfo>
  *        </geometryInfo>
  *      </head>
  *      <data>
  *        <timestep n="0">
  *          <controlPoints>
  *            <point>
  *              <x></x>
  *              <y></y>
  *              <z></z>
  *            </point>
  *          </controlPoint>
  *        </timestep>
  *      </data>
  *    </contourModel>
  */
 
 //
 // Initialization of the xml tags.
 //
 
 const char *mitk::ContourModelWriter::XML_CONTOURMODEL = "contourModel";
 
 const char *mitk::ContourModelWriter::XML_HEAD = "head";
 
 const char *mitk::ContourModelWriter::XML_GEOMETRY_INFO = "geometryInfo";
 
 const char *mitk::ContourModelWriter::XML_DATA = "data";
 
 const char *mitk::ContourModelWriter::XML_TIME_STEP = "timestep";
 
 const char *mitk::ContourModelWriter::XML_CONTROL_POINTS = "controlPoints";
 
 const char *mitk::ContourModelWriter::XML_POINT = "point";
 
 const char *mitk::ContourModelWriter::XML_X = "x";
 
 const char *mitk::ContourModelWriter::XML_Y = "y";
 
 const char *mitk::ContourModelWriter::XML_Z = "z";
 
-mitk::ContourModelWriter::ContourModelWriter()
-  : AbstractFileWriter(ContourModel::GetStaticNameOfClass()), m_IndentDepth(0), m_Indent(2)
+mitk::ContourModelWriter::ContourModelWriter(bool writeXMLHeader)
+  : AbstractFileWriter(ContourModel::GetStaticNameOfClass()), m_WriteXMLHeader(writeXMLHeader), m_IndentDepth(0), m_Indent(2)
 {
   std::string category = "Contour File";
   mitk::CustomMimeType customMimeType;
   customMimeType.SetCategory(category);
   customMimeType.AddExtension("cnt");
 
   this->SetDescription(category);
   this->SetMimeType(customMimeType);
 
   RegisterService();
 }
 
 mitk::ContourModelWriter::ContourModelWriter(const mitk::ContourModelWriter &other)
   : AbstractFileWriter(other), m_IndentDepth(other.m_IndentDepth), m_Indent(other.m_Indent)
 {
 }
 
 mitk::ContourModelWriter::~ContourModelWriter()
 {
 }
 
 void mitk::ContourModelWriter::Write()
 {
   std::ostream *out;
   std::ofstream outStream;
 
   if (this->GetOutputStream())
   {
     out = this->GetOutputStream();
   }
   else
   {
     outStream.open(this->GetOutputLocation().c_str());
     out = &outStream;
   }
 
   if (!out->good())
   {
     mitkThrow() << "Stream not good.";
   }
 
   std::locale previousLocale(out->getloc());
-  std::locale I("C");
-  out->imbue(I);
+  out->imbue(std::locale::classic());
 
   /*+++++++++++ Here the actual xml writing begins +++++++++*/
 
   /*++++ <?xml version="1.0" encoding="utf-8"?> ++++*/
-  WriteXMLHeader(*out);
+  if (m_WriteXMLHeader)
+    WriteXMLHeader(*out);
 
   //
   // for each input object write its xml representation to
   // the stream
   //
   mitk::ContourModel::ConstPointer contourModel = dynamic_cast<const mitk::ContourModel *>(this->GetInput());
   assert(contourModel.IsNotNull());
   WriteXML(contourModel.GetPointer(), *out);
 
   out->imbue(previousLocale);
 
   if (!out->good()) // some error during output
   {
     throw std::ios_base::failure("Some error during contour writing.");
   }
 }
 
 mitk::ContourModelWriter *mitk::ContourModelWriter::Clone() const
 {
   return new ContourModelWriter(*this);
 }
 
 void mitk::ContourModelWriter::WriteXML(const mitk::ContourModel *contourModel, std::ostream &out)
 {
   /*++++ <contourModel> ++++*/
   WriteStartElement(XML_CONTOURMODEL, out);
 
   /*++++ <head> ++++*/
   WriteStartElement(XML_HEAD, out);
 
   /*++++ <geometryInfo> ++++*/
   WriteStartElement(XML_GEOMETRY_INFO, out);
 
   WriteGeometryInformation(contourModel->GetTimeGeometry(), out);
 
   /*++++ </geometryInfo> ++++*/
   WriteEndElement(XML_GEOMETRY_INFO, out);
 
   /*++++ </head> ++++*/
   WriteEndElement(XML_HEAD, out);
 
   /*++++ <data> ++++*/
   WriteStartElement(XML_DATA, out);
 
   unsigned int timecount = contourModel->GetTimeSteps();
 
   for (unsigned int i = 0; i < timecount; i++)
   {
     /*++++ <timestep> ++++*/
     std::vector<std::string> at;
     at.push_back("n");
     std::vector<std::string> val;
     val.push_back(ConvertToString(i));
 
     at.push_back("isClosed");
     val.push_back(ConvertToString(contourModel->IsClosed()));
 
     WriteStartElementWithAttribut(XML_TIME_STEP, at, val, out);
 
     /*++++ <controlPoints> ++++*/
     WriteStartElement(XML_CONTROL_POINTS, out);
 
     auto it = contourModel->IteratorBegin();
     auto end = contourModel->IteratorEnd();
 
     while (it != end)
     {
       mitk::ContourModel::VertexType *v = *it;
 
       /*++++ <point> ++++*/
       std::vector<std::string> attr;
       attr.push_back("IsControlPoint");
       std::vector<std::string> value;
       value.push_back(ConvertToString(v->IsControlPoint));
       WriteStartElementWithAttribut(XML_POINT, attr, value, out);
 
       /*++++ <x> ++++*/
       WriteStartElement(XML_X, out);
       WriteCharacterData(ConvertToString(v->Coordinates[0]).c_str(), out);
       /*++++ </x> ++++*/
       WriteEndElement(XML_X, out, false);
 
       /*++++ <y> ++++*/
       WriteStartElement(XML_Y, out);
       WriteCharacterData(ConvertToString(v->Coordinates[1]).c_str(), out);
       /*++++ </y> ++++*/
       WriteEndElement(XML_Y, out, false);
 
       /*++++ <z> ++++*/
       WriteStartElement(XML_Z, out);
       WriteCharacterData(ConvertToString(v->Coordinates[2]).c_str(), out);
       /*++++ </z> ++++*/
       WriteEndElement(XML_Z, out, false);
 
       /*++++ </point> ++++*/
       WriteEndElement(XML_POINT, out);
 
       it++;
     }
 
     /*++++ </controlPoints> ++++*/
     WriteEndElement(XML_CONTROL_POINTS, out);
 
     /*++++ </timestep> ++++*/
     WriteEndElement(XML_TIME_STEP, out);
   }
 
   /*++++ </data> ++++*/
   WriteEndElement(XML_DATA, out);
 
   /*++++ </contourModel> ++++*/
   WriteEndElement(XML_CONTOURMODEL, out);
 }
 
 void mitk::ContourModelWriter::WriteGeometryInformation(const mitk::TimeGeometry * /*geometry*/, std::ostream &out)
 {
   WriteCharacterData("<!-- geometry information -->", out);
 }
 
 template <typename T>
 std::string mitk::ContourModelWriter::ConvertToString(T value)
 {
   std::ostringstream o;
   std::locale I("C");
   o.imbue(I);
 
   if (o << value)
   {
     return o.str();
   }
   else
     return "conversion error";
 }
 
 void mitk::ContourModelWriter::WriteXMLHeader(std::ostream &file)
 {
   file << "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
 }
 
 void mitk::ContourModelWriter::WriteStartElement(const char *const tag, std::ostream &file)
 {
   file << std::endl;
   WriteIndent(file);
   file << '<' << tag << '>';
   m_IndentDepth++;
 }
 
 void mitk::ContourModelWriter::WriteStartElementWithAttribut(const char *const tag,
                                                              std::vector<std::string> attributes,
                                                              std::vector<std::string> values,
                                                              std::ostream &file)
 {
   file << std::endl;
   WriteIndent(file);
   file << '<' << tag;
 
   unsigned int attributesSize = attributes.size();
   unsigned int valuesSize = values.size();
 
   if (attributesSize == valuesSize)
   {
     auto attributesIt = attributes.begin();
     auto end = attributes.end();
 
     auto valuesIt = values.begin();
 
     while (attributesIt != end)
     {
       file << ' ';
       WriteCharacterData(*attributesIt, file);
       file << '=' << '"';
       WriteCharacterData(*valuesIt, file);
       file << '"';
       attributesIt++;
       valuesIt++;
     }
   }
 
   file << '>';
   m_IndentDepth++;
 }
 
 void mitk::ContourModelWriter::WriteEndElement(const char *const tag, std::ostream &file, const bool &indent)
 {
   m_IndentDepth--;
   if (indent)
   {
     file << std::endl;
     WriteIndent(file);
   }
   file << '<' << '/' << tag << '>';
 }
 
 void mitk::ContourModelWriter::WriteCharacterData(const char *const data, std::ostream &file)
 {
   file << data;
 }
 
 void mitk::ContourModelWriter::WriteStartElement(std::string &tag, std::ostream &file)
 {
   WriteStartElement(tag.c_str(), file);
 }
 
 void mitk::ContourModelWriter::WriteEndElement(std::string &tag, std::ostream &file, const bool &indent)
 {
   WriteEndElement(tag.c_str(), file, indent);
 }
 
 void mitk::ContourModelWriter::WriteCharacterData(std::string &data, std::ostream &file)
 {
   WriteCharacterData(data.c_str(), file);
 }
 
 void mitk::ContourModelWriter::WriteIndent(std::ostream &file)
 {
   std::string spaces(m_IndentDepth * m_Indent, ' ');
   file << spaces.c_str();
 }
diff --git a/Modules/ContourModel/IO/mitkContourModelWriter.h b/Modules/ContourModel/IO/mitkContourModelWriter.h
index e338c4eee8..3a1b587533 100644
--- a/Modules/ContourModel/IO/mitkContourModelWriter.h
+++ b/Modules/ContourModel/IO/mitkContourModelWriter.h
@@ -1,169 +1,171 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef _MITK_CONTOURMODEL_WRITER__H_
 #define _MITK_CONTOURMODEL_WRITER__H_
 
 #include <mitkAbstractFileWriter.h>
 #include <mitkContourModel.h>
 
 // DEPRECATED
 #include <mitkTimeGeometry.h>
 
 namespace mitk
 {
   /**
    * @brief XML-based writer for mitk::ContourModels
    *
    * XML-based writer for mitk::ContourModels. Multiple ContourModels can be written in
    * a single XML file by simply setting multiple inputs to the filter.
    *
    * The xml file will look like:
    *
    *   <?xml version="1.0" encoding="utf-8"?>
    *   <contourModel>
    *      <head>
    *        <geometryInfo>
    *        </geometryInfo>
    *      </head>
    *      <data>
    *        <timestep n="0">
    *          <controlPoints>
    *            <point>
    *              <x></x>
    *              <y></y>
    *              <z></z>
    *            </point>
    *          </controlPoint>
    *        </timestep>
    *      </data>
    *    </contourModel>
    *
    * @ingroup MitkContourModelModule
    */
 
   class TimeSlicedGeometry;
 
   class ContourModelWriter : public mitk::AbstractFileWriter
   {
   public:
-    ContourModelWriter();
+    explicit ContourModelWriter(bool writeXMLHeader = true);
     ~ContourModelWriter() override;
 
     using AbstractFileWriter::Write;
     void Write() override;
 
   protected:
     ContourModelWriter(const ContourModelWriter &other);
 
     mitk::ContourModelWriter *Clone() const override;
 
     /**
      * Converts an arbitrary type to a string. The type has to
      * support the << operator. This works fine at least for integral
      * data types as float, int, long etc.
      * @param value the value to convert
      * @returns the string representation of value
      */
     template <typename T>
     std::string ConvertToString(T value);
 
     /**
      * Writes an XML representation of the given point set to
      * an outstream. The XML-Header an root node is not included!
      * @param contourModel the point set to be converted to xml
      * @param out the stream to write to.
      */
     void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out);
 
     /**
     * Writes the geometry information of the TimeGeometry to an outstream.
     * The root tag is not included.
     * @param geometry the TimeGeometry of the contour.
     * @param out the stream to write to.
     */
     void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out);
 
     /**
     * Writes the geometry information of the TimeGeometry to an outstream.
     * The root tag is not included.
     * @param geometry the TimeGeometry of the contour.
     * @param out the stream to write to.
     *
     * \deprecatedSince{2013_09} Please use TimeGeometry instead of TimeSlicedGeometry. For more information see
     * http://www.mitk.org/Development/Refactoring%20of%20the%20Geometry%20Classes%20-%20Part%201
     */
     DEPRECATED(void WriteGeometryInformation(const mitk::TimeSlicedGeometry *geometry, std::ostream &out));
 
     /**
      * Writes an standard xml header to the given stream.
      * @param file the stream in which the header is written.
      */
     void WriteXMLHeader(std::ostream &file);
 
     /** Write a start element tag */
     void WriteStartElement(const char *const tag, std::ostream &file);
 
     void WriteStartElementWithAttribut(const char *const tag,
                                        std::vector<std::string> attributes,
                                        std::vector<std::string> values,
                                        std::ostream &file);
 
     /**
      * Write an end element tag
      * End-Elements following character data should pass indent = false.
      */
     void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent = true);
 
     /** Write character data inside a tag. */
     void WriteCharacterData(const char *const data, std::ostream &file);
 
     /** Write a start element tag */
     void WriteStartElement(std::string &tag, std::ostream &file);
 
     /** Write an end element tag */
     void WriteEndElement(std::string &tag, std::ostream &file, const bool &indent = true);
 
     /** Write character data inside a tag. */
     void WriteCharacterData(std::string &data, std::ostream &file);
 
     /** Writes empty spaces to the stream according to m_IndentDepth and m_Indent */
     void WriteIndent(std::ostream &file);
 
+    bool m_WriteXMLHeader;
+
     unsigned int m_IndentDepth;
 
     unsigned int m_Indent;
 
   public:
     static const char *XML_CONTOURMODEL;
 
     static const char *XML_HEAD;
 
     static const char *XML_GEOMETRY_INFO;
 
     static const char *XML_DATA;
 
     static const char *XML_TIME_STEP;
 
     static const char *XML_CONTROL_POINTS;
 
     static const char *XML_POINT;
 
     static const char *XML_X;
 
     static const char *XML_Y;
 
     static const char *XML_Z;
   };
 }
 
 #endif
diff --git a/Modules/Core/CMakeLists.txt b/Modules/Core/CMakeLists.txt
index 40e19fd8b4..8a143eee99 100644
--- a/Modules/Core/CMakeLists.txt
+++ b/Modules/Core/CMakeLists.txt
@@ -1,65 +1,70 @@
 
 set(TOOL_CPPS "")
 
 # temporary suppress warnings in the following files until image accessors are fully integrated.
 set_source_files_properties( src/DataManagement/mitkImage.cpp COMPILE_FLAGS -DMITK_NO_DEPRECATED_WARNINGS )
 set_source_files_properties( src/Controllers/mitkSliceNavigationController.cpp COMPILE_FLAGS -DMITK_NO_DEPRECATED_WARNINGS )
 
 MITK_CREATE_MODULE(
   INCLUDE_DIRS
     PUBLIC ${MITK_BINARY_DIR}
     PRIVATE src/Algorithms src/Controllers src/DataManagement src/Interactions src/IO src/Rendering ${OPENGL_INCLUDE_DIR}
   DEPENDS PUBLIC mbilog CppMicroServices
   PACKAGE_DEPENDS
-    PRIVATE tinyxml OpenGL
+    PRIVATE tinyxml2|tinyxml2 OpenGL
     PUBLIC  ITK|ITKTransform+ITKImageGrid+ITKImageFeature+ITKIOImageBase+ITKIOHDF5+ITKIOLSM+ITKIOMRC+ITKIOBioRad+ITKIOGE+ITKIOStimulate+ITKIOBruker+ITKIOMINC
     # We privately use/link all ITK modules in order to support all IO, Transform, etc.
     # factories from ITK which are registered "automatically" via a factory manager.
     PRIVATE ITK
     PUBLIC  VTK|FiltersTexture+FiltersParallel+ImagingStencil+ImagingMath+InteractionStyle+RenderingOpenGL2+RenderingVolumeOpenGL2+RenderingFreeType+RenderingLabel+InteractionWidgets+IOGeometry+IOXML
     PUBLIC  Boost|boost
   # Do not automatically create CppMicroServices initialization code.
   # Because the VTK 6 "auto-init" functionality injects file-local static
   # initialization code in every cpp file which includes a VTK header,
   # static initialization order becomes an issue again. For the Mitk
   # core library, we need to ensure that the VTK static initialization stuff
   # happens before the CppMicroServices initialization, since the latter
   # might already use VTK code which needs to access VTK object factories.
   # Hence, CppMicroServices initialization code is placed manually within
   # the mitkCoreActivator.cpp file.
   NO_INIT
 )
 if(NOT TARGET ${MODULE_TARGET})
   message(SEND_ERROR "Core target ${MODULE_TARGET} does not exist")
 endif()
+
+target_link_libraries(${MODULE_TARGET}
+  PRIVATE tinyxml2::tinyxml2
+)
+
 function(_itk_create_factory_register_manager)
   # In MITK_ITK_Config.cmake, we do *not* include ITK_USE_FILE, which
   # prevents multiple registrations/unregistrations of ITK IO factories
   # during library loading/unloading (of MITK libraries). However, we need
   # "one" place where the IO factories are registered at
   # least once. This could be the application executable, but every executable would
   # need to take care of that itself. Instead, we allow the auto registration in the
   # Mitk Core library.
   set(NO_DIRECTORY_SCOPED_ITK_COMPILE_DEFINITION 1)
   find_package(ITK)
   include(${ITK_USE_FILE})
 
   if(NOT ITK_NO_IO_FACTORY_REGISTER_MANAGER)
     # We manually add the define which will be of target scope. MITK
     # patches ITK_USE_FILE to remove the directory scoped compile
     # definition since it would be propagated to other targets in the
     # same directory scope but these targets might want to *not*
     # use the ITK factory manager stuff.
     target_compile_definitions(${MODULE_TARGET} PRIVATE ITK_IO_FACTORY_REGISTER_MANAGER)
   endif()
 endfunction()
 _itk_create_factory_register_manager()
 
 if(MSVC_IDE OR MSVC_VERSION)
   target_link_libraries(${MODULE_TARGET} PRIVATE psapi.lib)
 endif()
 
 if(BUILD_TESTING)
   add_subdirectory(TestingHelper)
   add_subdirectory(test)
 endif()
diff --git a/Modules/Core/TestingHelper/CMakeLists.txt b/Modules/Core/TestingHelper/CMakeLists.txt
index c1d32c6cfd..a317355092 100644
--- a/Modules/Core/TestingHelper/CMakeLists.txt
+++ b/Modules/Core/TestingHelper/CMakeLists.txt
@@ -1,7 +1,12 @@
 mitk_create_module(
   DEPENDS PUBLIC MitkCore
   PACKAGE_DEPENDS
-    PUBLIC CppUnit
-    PRIVATE VTK|IOImage+TestingRendering tinyxml OpenGL
+    PUBLIC CppUnit tinyxml2|tinyxml2
+    PRIVATE VTK|IOImage+TestingRendering OpenGL
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PUBLIC tinyxml2::tinyxml2
+  )
+endif()
diff --git a/Modules/Core/TestingHelper/src/mitkInteractionTestHelper.cpp b/Modules/Core/TestingHelper/src/mitkInteractionTestHelper.cpp
index dea87c3ef7..92578ca3cf 100644
--- a/Modules/Core/TestingHelper/src/mitkInteractionTestHelper.cpp
+++ b/Modules/Core/TestingHelper/src/mitkInteractionTestHelper.cpp
@@ -1,432 +1,429 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include <mitkIOUtil.h>
 #include <mitkInteractionEventConst.h>
 #include <mitkInteractionTestHelper.h>
 #include <mitkPlaneGeometryDataMapper2D.h>
 #include <mitkStandaloneDataStorage.h>
 
 // VTK
 #include <vtkCamera.h>
 #include <vtkRenderWindowInteractor.h>
 
 // us
 #include <usGetModuleContext.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 mitk::InteractionTestHelper::InteractionTestHelper(const std::string &interactionXmlFilePath)
   : m_InteractionFilePath(interactionXmlFilePath)
 {
   this->Initialize(interactionXmlFilePath);
 }
 
 void mitk::InteractionTestHelper::Initialize(const std::string &interactionXmlFilePath)
 {
-  // TiXmlDocument document(interactionXmlPath.c_str());
-  TiXmlDocument document(interactionXmlFilePath);
-  bool loadOkay = document.LoadFile();
-  if (loadOkay)
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS == document.LoadFile(interactionXmlFilePath.c_str()))
   {
     // get RenderingManager instance
     auto rm = mitk::RenderingManager::GetInstance();
 
     // create data storage
     m_DataStorage = mitk::StandaloneDataStorage::New();
 
     // for each renderer found create a render window and configure
-    for (TiXmlElement *element = document.FirstChildElement(mitk::InteractionEventConst::xmlTagInteractions())
-                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagConfigRoot())
-                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagRenderer());
+    for (auto *element = document.FirstChildElement(mitk::InteractionEventConst::xmlTagInteractions().c_str())
+                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagConfigRoot().c_str())
+                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagRenderer().c_str());
          element != nullptr;
-         element = element->NextSiblingElement(mitk::InteractionEventConst::xmlTagRenderer()))
+         element = element->NextSiblingElement(mitk::InteractionEventConst::xmlTagRenderer().c_str()))
     {
       // get name of renderer
       const char *rendererName =
         element->Attribute(mitk::InteractionEventConst::xmlEventPropertyRendererName().c_str());
 
       // get view direction
       mitk::SliceNavigationController::ViewDirection viewDirection = mitk::SliceNavigationController::Axial;
-      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyViewDirection()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyViewDirection().c_str()) != nullptr)
       {
         int viewDirectionNum =
-          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyViewDirection())->c_str());
+          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyViewDirection().c_str()));
         viewDirection = static_cast<mitk::SliceNavigationController::ViewDirection>(viewDirectionNum);
       }
 
       // get mapper slot id
       mitk::BaseRenderer::MapperSlotId mapperID = mitk::BaseRenderer::Standard2D;
-      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID().c_str()) != nullptr)
       {
         int mapperIDNum =
-          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID())->c_str());
+          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID().c_str()));
         mapperID = static_cast<mitk::BaseRenderer::MapperSlotId>(mapperIDNum);
       }
 
       // Get Size of Render Windows
       int size[3];
       size[0] = size[1] = size[2] = 0;
-      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeX()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeX().c_str()) != nullptr)
       {
-        size[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeX())->c_str());
+        size[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeX().c_str()));
       }
-      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeY()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeY().c_str()) != nullptr)
       {
-        size[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeY())->c_str());
+        size[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeY().c_str()));
       }
-      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeZ()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlRenderSizeZ().c_str()) != nullptr)
       {
-        size[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeZ())->c_str());
+        size[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlRenderSizeZ().c_str()));
       }
 
       // create renderWindow, renderer and dispatcher
       auto rw = RenderWindow::New(nullptr, rendererName); // VtkRenderWindow is created within constructor if nullptr
 
       if (size[0] != 0 && size[1] != 0)
       {
         rw->SetSize(size[0], size[1]);
         rw->GetRenderer()->Resize(size[0], size[1]);
       }
 
       // set storage of renderer
       rw->GetRenderer()->SetDataStorage(m_DataStorage);
 
       // set view direction to axial
       rw->GetSliceNavigationController()->SetDefaultViewDirection(viewDirection);
 
       // set renderer to render 2D
       rw->GetRenderer()->SetMapperID(mapperID);
 
       rw->GetRenderer()->PrepareRender();
 
       // Some more magic for the 3D render window case:
       // Camera view direction, position and focal point
 
       if (mapperID == mitk::BaseRenderer::Standard3D)
       {
-        if (element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX().c_str()) != nullptr)
         {
           double cameraFocalPoint[3];
 
           cameraFocalPoint[0] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX().c_str()));
           cameraFocalPoint[1] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointY())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointY().c_str()));
           cameraFocalPoint[2] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointZ())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointZ().c_str()));
           rw->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetFocalPoint(cameraFocalPoint);
         }
 
-        if (element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX().c_str()) != nullptr)
         {
           double cameraPosition[3];
 
-          cameraPosition[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX())->c_str());
-          cameraPosition[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionY())->c_str());
-          cameraPosition[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionZ())->c_str());
+          cameraPosition[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX().c_str()));
+          cameraPosition[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionY().c_str()));
+          cameraPosition[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionZ().c_str()));
           rw->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetPosition(cameraPosition);
         }
 
-        if (element->Attribute(mitk::InteractionEventConst::xmlViewUpX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlViewUpX().c_str()) != nullptr)
         {
           double viewUp[3];
 
-          viewUp[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpX())->c_str());
-          viewUp[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpY())->c_str());
-          viewUp[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpZ())->c_str());
+          viewUp[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpX().c_str()));
+          viewUp[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpY().c_str()));
+          viewUp[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpZ().c_str()));
           rw->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetViewUp(viewUp);
         }
       }
 
       rw->GetVtkRenderWindow()->Render();
       rw->GetVtkRenderWindow()->WaitForCompletion();
 
       // connect SliceNavigationControllers to timestep changed event of TimeNavigationController
       rw->GetSliceNavigationController()->ConnectGeometryTimeEvent(rm->GetTimeNavigationController(), false);
       rm->GetTimeNavigationController()->ConnectGeometryTimeEvent(rw->GetSliceNavigationController(), false);
 
       // add to list of kown render windows
       m_RenderWindowList.push_back(rw);
     }
 
     // TODO: check the following lines taken from QmitkStdMultiWidget and adapt them to be executed in our code here.
     //    mitkWidget1->GetSliceNavigationController()
     //      ->ConnectGeometrySendEvent(mitk::BaseRenderer::GetInstance(mitkWidget4->GetRenderWindow()));
 
     //########### register display interactor to handle scroll events ##################
     // use MouseModeSwitcher to ensure that the statemachine of DisplayInteractor is loaded correctly
     m_MouseModeSwitcher = mitk::MouseModeSwitcher::New();
   }
   else
   {
     mitkThrow() << "Can not load interaction xml file <" << m_InteractionFilePath << ">";
   }
 
   // WARNING assumes a 3D window exists !!!!
   this->AddDisplayPlaneSubTree();
 }
 
 mitk::InteractionTestHelper::~InteractionTestHelper()
 {
   mitk::RenderingManager *rm = mitk::RenderingManager::GetInstance();
 
   // unregister renderers
   auto it = m_RenderWindowList.begin();
   auto end = m_RenderWindowList.end();
 
   for (; it != end; ++it)
   {
     rm->GetTimeNavigationController()->Disconnect((*it)->GetSliceNavigationController());
     (*it)->GetSliceNavigationController()->Disconnect(rm->GetTimeNavigationController());
     mitk::BaseRenderer::RemoveInstance((*it)->GetVtkRenderWindow());
   }
   rm->RemoveAllObservers();
 }
 
 mitk::DataStorage::Pointer mitk::InteractionTestHelper::GetDataStorage()
 {
   return m_DataStorage;
 }
 
 void mitk::InteractionTestHelper::AddNodeToStorage(mitk::DataNode::Pointer node)
 {
   this->m_DataStorage->Add(node);
 
   this->Set3dCameraSettings();
 }
 
 void mitk::InteractionTestHelper::PlaybackInteraction()
 {
   mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(m_DataStorage);
   // load events if not loaded yet
   if (m_Events.empty())
     this->LoadInteraction();
 
   auto it = m_RenderWindowList.begin();
   auto end = m_RenderWindowList.end();
   for (; it != end; ++it)
   {
     (*it)->GetRenderer()->PrepareRender();
 
     (*it)->GetVtkRenderWindow()->Render();
     (*it)->GetVtkRenderWindow()->WaitForCompletion();
   }
   mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(m_DataStorage);
 
   it = m_RenderWindowList.begin();
   for (; it != end; ++it)
   {
     (*it)->GetVtkRenderWindow()->Render();
     (*it)->GetVtkRenderWindow()->WaitForCompletion();
   }
 
   // mitk::RenderingManager::GetInstance()->ForceImmediateUpdateAll();
   // playback all events in queue
   for (unsigned long i = 0; i < m_Events.size(); ++i)
   {
     // let dispatcher of sending renderer process the event
     m_Events.at(i)->GetSender()->GetDispatcher()->ProcessEvent(m_Events.at(i));
   }
   if (false)
   {
     it--;
     (*it)->GetVtkRenderWindow()->GetInteractor()->Start();
   }
 }
 
 void mitk::InteractionTestHelper::LoadInteraction()
 {
   // load interaction pattern from xml file
   std::ifstream xmlStream(m_InteractionFilePath.c_str());
   mitk::XML2EventParser parser(xmlStream);
   m_Events = parser.GetInteractions();
   xmlStream.close();
   // Avoid VTK warning: Trying to delete object with non-zero reference count.
   parser.SetReferenceCount(0);
 }
 
 void mitk::InteractionTestHelper::SetTimeStep(int newTimeStep)
 {
   mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(m_DataStorage);
 
   bool timeStepIsvalid =
     mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetCreatedWorldGeometry()->IsValidTimeStep(
       newTimeStep);
 
   if (timeStepIsvalid)
   {
     mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetTime()->SetPos(newTimeStep);
   }
 }
 
 mitk::RenderWindow *mitk::InteractionTestHelper::GetRenderWindowByName(const std::string &name)
 {
   auto it = m_RenderWindowList.begin();
   auto end = m_RenderWindowList.end();
 
   for (; it != end; ++it)
   {
     if (name.compare((*it)->GetRenderer()->GetName()) == 0)
       return (*it).GetPointer();
   }
 
   return nullptr;
 }
 
 mitk::RenderWindow *mitk::InteractionTestHelper::GetRenderWindowByDefaultViewDirection(
   mitk::SliceNavigationController::ViewDirection viewDirection)
 {
   auto it = m_RenderWindowList.begin();
   auto end = m_RenderWindowList.end();
 
   for (; it != end; ++it)
   {
     if (viewDirection == (*it)->GetSliceNavigationController()->GetDefaultViewDirection())
       return (*it).GetPointer();
   }
 
   return nullptr;
 }
 
 mitk::RenderWindow *mitk::InteractionTestHelper::GetRenderWindow(unsigned int index)
 {
   if (index < m_RenderWindowList.size())
   {
     return m_RenderWindowList.at(index).GetPointer();
   }
   else
   {
     return nullptr;
   }
 }
 
 void mitk::InteractionTestHelper::AddDisplayPlaneSubTree()
 {
   // add the displayed planes of the multiwidget to a node to which the subtree
   // @a planesSubTree points ...
 
   mitk::PlaneGeometryDataMapper2D::Pointer mapper;
   mitk::IntProperty::Pointer layer = mitk::IntProperty::New(1000);
 
   mitk::DataNode::Pointer node = mitk::DataNode::New();
   node->SetProperty("name", mitk::StringProperty::New("Widgets"));
   node->SetProperty("helper object", mitk::BoolProperty::New(true));
 
   m_DataStorage->Add(node);
 
   for (auto it : m_RenderWindowList)
   {
     if (it->GetRenderer()->GetMapperID() == BaseRenderer::Standard3D)
       continue;
 
     // ... of widget 1
     mitk::DataNode::Pointer planeNode1 =
       (mitk::BaseRenderer::GetInstance(it->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
 
     planeNode1->SetProperty("visible", mitk::BoolProperty::New(true));
     planeNode1->SetProperty("name", mitk::StringProperty::New("widget1Plane"));
     planeNode1->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
     planeNode1->SetProperty("helper object", mitk::BoolProperty::New(true));
     planeNode1->SetProperty("layer", layer);
     planeNode1->SetColor(1.0, 0.0, 0.0);
     mapper = mitk::PlaneGeometryDataMapper2D::New();
     planeNode1->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
     m_DataStorage->Add(planeNode1, node);
   }
 }
 
 void mitk::InteractionTestHelper::Set3dCameraSettings()
 {
-  TiXmlDocument document(m_InteractionFilePath);
-  bool loadOkay = document.LoadFile();
-  if (loadOkay)
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS == document.LoadFile(m_InteractionFilePath.c_str()))
   {
     // for each renderer found create a render window and configure
-    for (TiXmlElement *element = document.FirstChildElement(mitk::InteractionEventConst::xmlTagInteractions())
-                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagConfigRoot())
-                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagRenderer());
+    for (auto *element = document.FirstChildElement(mitk::InteractionEventConst::xmlTagInteractions().c_str())
+                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagConfigRoot().c_str())
+                                   ->FirstChildElement(mitk::InteractionEventConst::xmlTagRenderer().c_str());
          element != nullptr;
-         element = element->NextSiblingElement(mitk::InteractionEventConst::xmlTagRenderer()))
+         element = element->NextSiblingElement(mitk::InteractionEventConst::xmlTagRenderer().c_str()))
     {
       // get name of renderer
       const char *rendererName =
         element->Attribute(mitk::InteractionEventConst::xmlEventPropertyRendererName().c_str());
 
       // get mapper slot id
       mitk::BaseRenderer::MapperSlotId mapperID = mitk::BaseRenderer::Standard2D;
-      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID()) != nullptr)
+      if (element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID().c_str()) != nullptr)
       {
         int mapperIDNum =
-          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID())->c_str());
+          std::atoi(element->Attribute(mitk::InteractionEventConst::xmlEventPropertyMapperID().c_str()));
         mapperID = static_cast<mitk::BaseRenderer::MapperSlotId>(mapperIDNum);
       }
 
       if (mapperID == mitk::BaseRenderer::Standard3D)
       {
         RenderWindow *namedRenderer = nullptr;
 
         for (auto it : m_RenderWindowList)
         {
           if (strcmp(it->GetRenderer()->GetName(), rendererName) == 0)
           {
             namedRenderer = it.GetPointer();
             break;
           }
         }
 
         if (namedRenderer == nullptr)
         {
           MITK_ERROR << "No match for render window was found.";
           return;
         }
         namedRenderer->GetRenderer()->PrepareRender();
 
-        if (element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX().c_str()) != nullptr)
         {
           double cameraFocalPoint[3];
 
           cameraFocalPoint[0] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointX().c_str()));
           cameraFocalPoint[1] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointY())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointY().c_str()));
           cameraFocalPoint[2] =
-            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointZ())->c_str());
+            std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraFocalPointZ().c_str()));
           namedRenderer->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetFocalPoint(cameraFocalPoint);
         }
 
-        if (element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX().c_str()) != nullptr)
         {
           double cameraPosition[3];
 
-          cameraPosition[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX())->c_str());
-          cameraPosition[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionY())->c_str());
-          cameraPosition[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionZ())->c_str());
+          cameraPosition[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionX().c_str()));
+          cameraPosition[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionY().c_str()));
+          cameraPosition[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlCameraPositionZ().c_str()));
           namedRenderer->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetPosition(cameraPosition);
         }
 
-        if (element->Attribute(mitk::InteractionEventConst::xmlViewUpX()) != nullptr)
+        if (element->Attribute(mitk::InteractionEventConst::xmlViewUpX().c_str()) != nullptr)
         {
           double viewUp[3];
 
-          viewUp[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpX())->c_str());
-          viewUp[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpY())->c_str());
-          viewUp[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpZ())->c_str());
+          viewUp[0] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpX().c_str()));
+          viewUp[1] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpY().c_str()));
+          viewUp[2] = std::atoi(element->Attribute(mitk::InteractionEventConst::xmlViewUpZ().c_str()));
           namedRenderer->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetViewUp(viewUp);
         }
 
         namedRenderer->GetVtkRenderWindow()->Render();
       }
     }
   }
 }
diff --git a/Modules/Core/include/mitkGeometryDataReaderService.h b/Modules/Core/include/mitkGeometryDataReaderService.h
index 1c7f8e23cb..aa95947ed4 100644
--- a/Modules/Core/include/mitkGeometryDataReaderService.h
+++ b/Modules/Core/include/mitkGeometryDataReaderService.h
@@ -1,61 +1,59 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkGeometryDataReaderService_h
 #define mitkGeometryDataReaderService_h
 
 // MITK
 #include <mitkAbstractFileReader.h>
 #include <mitkGeometryData.h>
 
-class TiXmlElement;
-
 namespace mitk
 {
   /**
    * @internal
    *
    * @brief reads XML representations of mitk::GeometryData from a file/stream.
    *
    * To be used via IOUtil.
    *
    * Reader for XML files containing one or multiple XML represenations of
    * mitk::GeometryData. If multiple mitk::GeometryData objects are stored in one file,
    * these are assigned to multiple BaseData objects.
    *
    * @sa Geometry3DToXML
    *
    * @ingroup IO
    */
   class GeometryDataReaderService : public AbstractFileReader
   {
   public:
     GeometryDataReaderService();
     ~GeometryDataReaderService() override;
 
     using AbstractFileReader::Read;
 
     /**
      * @brief Provides the MIME type for reader and writer.
      */
     static CustomMimeType GEOMETRY_DATA_MIMETYPE();
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
   private:
     GeometryDataReaderService(const GeometryDataReaderService &other);
 
     GeometryDataReaderService *Clone() const override;
   };
 }
 
 #endif
diff --git a/Modules/Core/include/mitkGeometryDataWriterService.h b/Modules/Core/include/mitkGeometryDataWriterService.h
index 6544cd8f4e..6de0ddabd4 100644
--- a/Modules/Core/include/mitkGeometryDataWriterService.h
+++ b/Modules/Core/include/mitkGeometryDataWriterService.h
@@ -1,55 +1,52 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkGeometryDataWriterService_h
 #define mitkGeometryDataWriterService_h
 
 #include <mitkAbstractFileWriter.h>
 #include <mitkGeometryData.h>
 
-// forward
-class TiXmlNode;
-
 namespace mitk
 {
   // forward
   class Geometry3D;
 
   /**
    * @internal
    *
    * @brief XML-based writer for mitk::GeometryData
    *
    * XML-based writer for mitk::GeometryData. Multiple GeometryData instances
    * can be written in a single XML file by simply setting multiple inputs to the filter.
    *
    * @sa Geometry3DToXML
    *
    * @ingroup IO
    */
   class GeometryDataWriterService : public AbstractFileWriter
   {
   public:
     GeometryDataWriterService();
     ~GeometryDataWriterService() override;
 
     using AbstractFileWriter::Write;
     void Write() override;
 
   private:
     GeometryDataWriterService(const GeometryDataWriterService &other);
 
     mitk::GeometryDataWriterService *Clone() const override;
   };
 }
 
 #endif
diff --git a/Modules/Core/include/mitkPlaneOrientationProperty.h b/Modules/Core/include/mitkPlaneOrientationProperty.h
index 54798b7f00..3d97490348 100644
--- a/Modules/Core/include/mitkPlaneOrientationProperty.h
+++ b/Modules/Core/include/mitkPlaneOrientationProperty.h
@@ -1,122 +1,122 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef MITK_PLANE_DECORATION_PROPERTY__H
 #define MITK_PLANE_DECORATION_PROPERTY__H
 
 #include "mitkEnumerationProperty.h"
 
 namespace mitk
 {
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable : 4522)
 #endif
 
   /**
    * Property which controls whether 2D line representation of a PlaneGeometry
    * should have small arrows at both ends to indicate the orientation of
    * the plane, and whether the arrows should be oriented in the direction of
    * the plane's normal or against it.
    *
    * Valid values of the enumeration property are
    * - PLANE_DECORATION_NONE (no arrows)
    * - PLANE_DECORATION_POSITIVE_ORIENTATION (arrows pointing upwards)
    * - PLANE_DECORATION_NEGATIVE_ORIENTATION (arrows pointing downwards)
    *
    * See also mitk::PlaneGeometryDataMapper2D::DrawOrientationArrow()
    */
   class MITKCORE_EXPORT PlaneOrientationProperty : public EnumerationProperty
   {
   public:
     mitkClassMacro(PlaneOrientationProperty, EnumerationProperty);
 
     itkFactorylessNewMacro(Self);
 
     itkCloneMacro(Self);
 
-      mitkNewMacro1Param(PlaneOrientationProperty, const IdType &);
+    mitkNewMacro1Param(PlaneOrientationProperty, const IdType &);
 
     mitkNewMacro1Param(PlaneOrientationProperty, const std::string &);
 
     enum
     {
       PLANE_DECORATION_NONE,
       PLANE_DECORATION_POSITIVE_ORIENTATION,
       PLANE_DECORATION_NEGATIVE_ORIENTATION
     };
 
     /**
      * Returns the state of plane decoration.
      */
     virtual int GetPlaneDecoration();
 
     /**
      * Sets the decoration type to no decoration.
      */
     virtual void SetPlaneDecorationToNone();
 
     /**
      * Sets the decoration type to arrows in positive plane direction.
      */
     virtual void SetPlaneDecorationToPositiveOrientation();
 
     /**
      * Sets the decoration type to arrows in negative plane direction.
      */
     virtual void SetPlaneDecorationToNegativeOrientation();
 
     using BaseProperty::operator=;
 
   protected:
     /**
      * Constructor. Sets the decoration type to none.
      */
     PlaneOrientationProperty();
 
     /**
      * Constructor. Sets the decoration type to the given value. If it is not
      * valid, the interpolation is set to none
      */
     PlaneOrientationProperty(const IdType &value);
 
     /**
      * Constructor. Sets the decoration type to the given value. If it is not
      * valid, the representation is set to none
      */
     PlaneOrientationProperty(const std::string &value);
 
     /**
      * this function is overridden as protected, so that the user may not add
      * additional invalid types.
      */
     bool AddEnum(const std::string &name, const IdType &id) override;
 
     /**
      * Adds the standard enumeration types with corresponding strings.
      */
     virtual void AddDecorationTypes();
 
   private:
     // purposely not implemented
     PlaneOrientationProperty &operator=(const PlaneOrientationProperty &);
 
     itk::LightObject::Pointer InternalClone() const override;
   };
 
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
 
 } // end of namespace mitk
 
 #endif
diff --git a/Modules/Core/src/IO/mitkGeometry3DToXML.cpp b/Modules/Core/src/IO/mitkGeometry3DToXML.cpp
index c611eac6c7..e9ee434cf7 100644
--- a/Modules/Core/src/IO/mitkGeometry3DToXML.cpp
+++ b/Modules/Core/src/IO/mitkGeometry3DToXML.cpp
@@ -1,236 +1,242 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkGeometry3DToXML.h"
 
 #include <mitkLexicalCast.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
-TiXmlElement *mitk::Geometry3DToXML::ToXML(const Geometry3D *geom3D)
+#include <array>
+
+tinyxml2::XMLElement *mitk::Geometry3DToXML::ToXML(tinyxml2::XMLDocument& doc, const Geometry3D *geom3D)
 {
   assert(geom3D);
 
   // really serialize
   const AffineTransform3D *transform = geom3D->GetIndexToWorldTransform();
 
   // get transform parameters that would need to be serialized
   AffineTransform3D::MatrixType matrix = transform->GetMatrix();
   AffineTransform3D::OffsetType offset = transform->GetOffset();
 
   bool isImageGeometry = geom3D->GetImageGeometry();
   BaseGeometry::BoundsArrayType bounds = geom3D->GetBounds();
 
   // create XML file
   // construct XML tree describing the geometry
-  auto *geomElem = new TiXmlElement("Geometry3D");
-  geomElem->SetAttribute("ImageGeometry", isImageGeometry ? "true" : "false");
+  auto *geomElem = doc.NewElement("Geometry3D");
+  geomElem->SetAttribute("ImageGeometry", isImageGeometry);
   geomElem->SetAttribute("FrameOfReferenceID", geom3D->GetFrameOfReferenceID());
 
   // coefficients are matrix[row][column]!
-  auto *matrixElem = new TiXmlElement("IndexToWorld");
+  auto *matrixElem = doc.NewElement("IndexToWorld");
   matrixElem->SetAttribute("type", "Matrix3x3");
-  matrixElem->SetAttribute("m_0_0", boost::lexical_cast<std::string>(matrix[0][0]));
-  matrixElem->SetAttribute("m_0_1", boost::lexical_cast<std::string>(matrix[0][1]));
-  matrixElem->SetAttribute("m_0_2", boost::lexical_cast<std::string>(matrix[0][2]));
-  matrixElem->SetAttribute("m_1_0", boost::lexical_cast<std::string>(matrix[1][0]));
-  matrixElem->SetAttribute("m_1_1", boost::lexical_cast<std::string>(matrix[1][1]));
-  matrixElem->SetAttribute("m_1_2", boost::lexical_cast<std::string>(matrix[1][2]));
-  matrixElem->SetAttribute("m_2_0", boost::lexical_cast<std::string>(matrix[2][0]));
-  matrixElem->SetAttribute("m_2_1", boost::lexical_cast<std::string>(matrix[2][1]));
-  matrixElem->SetAttribute("m_2_2", boost::lexical_cast<std::string>(matrix[2][2]));
-  geomElem->LinkEndChild(matrixElem);
-
-  auto *offsetElem = new TiXmlElement("Offset");
+  matrixElem->SetAttribute("m_0_0", boost::lexical_cast<std::string>(matrix[0][0]).c_str());
+  matrixElem->SetAttribute("m_0_1", boost::lexical_cast<std::string>(matrix[0][1]).c_str());
+  matrixElem->SetAttribute("m_0_2", boost::lexical_cast<std::string>(matrix[0][2]).c_str());
+  matrixElem->SetAttribute("m_1_0", boost::lexical_cast<std::string>(matrix[1][0]).c_str());
+  matrixElem->SetAttribute("m_1_1", boost::lexical_cast<std::string>(matrix[1][1]).c_str());
+  matrixElem->SetAttribute("m_1_2", boost::lexical_cast<std::string>(matrix[1][2]).c_str());
+  matrixElem->SetAttribute("m_2_0", boost::lexical_cast<std::string>(matrix[2][0]).c_str());
+  matrixElem->SetAttribute("m_2_1", boost::lexical_cast<std::string>(matrix[2][1]).c_str());
+  matrixElem->SetAttribute("m_2_2", boost::lexical_cast<std::string>(matrix[2][2]).c_str());
+  geomElem->InsertEndChild(matrixElem);
+
+  auto *offsetElem = doc.NewElement("Offset");
   offsetElem->SetAttribute("type", "Vector3D");
-  offsetElem->SetAttribute("x", boost::lexical_cast<std::string>(offset[0]));
-  offsetElem->SetAttribute("y", boost::lexical_cast<std::string>(offset[1]));
-  offsetElem->SetAttribute("z", boost::lexical_cast<std::string>(offset[2]));
-  geomElem->LinkEndChild(offsetElem);
+  offsetElem->SetAttribute("x", boost::lexical_cast<std::string>(offset[0]).c_str());
+  offsetElem->SetAttribute("y", boost::lexical_cast<std::string>(offset[1]).c_str());
+  offsetElem->SetAttribute("z", boost::lexical_cast<std::string>(offset[2]).c_str());
+  geomElem->InsertEndChild(offsetElem);
 
-  auto *boundsElem = new TiXmlElement("Bounds");
-  auto *boundsMinElem = new TiXmlElement("Min");
+  auto *boundsElem = doc.NewElement("Bounds");
+  auto *boundsMinElem = doc.NewElement("Min");
   boundsMinElem->SetAttribute("type", "Vector3D");
-  boundsMinElem->SetAttribute("x", boost::lexical_cast<std::string>(bounds[0]));
-  boundsMinElem->SetAttribute("y", boost::lexical_cast<std::string>(bounds[2]));
-  boundsMinElem->SetAttribute("z", boost::lexical_cast<std::string>(bounds[4]));
-  boundsElem->LinkEndChild(boundsMinElem);
-  auto *boundsMaxElem = new TiXmlElement("Max");
+  boundsMinElem->SetAttribute("x", boost::lexical_cast<std::string>(bounds[0]).c_str());
+  boundsMinElem->SetAttribute("y", boost::lexical_cast<std::string>(bounds[2]).c_str());
+  boundsMinElem->SetAttribute("z", boost::lexical_cast<std::string>(bounds[4]).c_str());
+  boundsElem->InsertEndChild(boundsMinElem);
+  auto *boundsMaxElem = doc.NewElement("Max");
   boundsMaxElem->SetAttribute("type", "Vector3D");
-  boundsMaxElem->SetAttribute("x", boost::lexical_cast<std::string>(bounds[1]));
-  boundsMaxElem->SetAttribute("y", boost::lexical_cast<std::string>(bounds[3]));
-  boundsMaxElem->SetAttribute("z", boost::lexical_cast<std::string>(bounds[5]));
-  boundsElem->LinkEndChild(boundsMaxElem);
-  geomElem->LinkEndChild(boundsElem);
+  boundsMaxElem->SetAttribute("x", boost::lexical_cast<std::string>(bounds[1]).c_str());
+  boundsMaxElem->SetAttribute("y", boost::lexical_cast<std::string>(bounds[3]).c_str());
+  boundsMaxElem->SetAttribute("z", boost::lexical_cast<std::string>(bounds[5]).c_str());
+  boundsElem->InsertEndChild(boundsMaxElem);
+  geomElem->InsertEndChild(boundsElem);
 
   return geomElem;
 }
 
-mitk::Geometry3D::Pointer mitk::Geometry3DToXML::FromXML(TiXmlElement *geometryElement)
+mitk::Geometry3D::Pointer mitk::Geometry3DToXML::FromXML(const tinyxml2::XMLElement *geometryElement)
 {
   if (!geometryElement)
   {
     MITK_ERROR << "Cannot deserialize Geometry3D from nullptr.";
     return nullptr;
   }
 
   AffineTransform3D::MatrixType matrix;
   AffineTransform3D::OffsetType offset;
   bool isImageGeometry(false);
   unsigned int frameOfReferenceID(0);
   BaseGeometry::BoundsArrayType bounds;
 
-  if (TIXML_SUCCESS != geometryElement->QueryUnsignedAttribute("FrameOfReferenceID", &frameOfReferenceID))
+  if (tinyxml2::XML_SUCCESS != geometryElement->QueryUnsignedAttribute("FrameOfReferenceID", &frameOfReferenceID))
   {
     MITK_WARN << "Missing FrameOfReference for Geometry3D.";
   }
 
-  if (TIXML_SUCCESS != geometryElement->QueryBoolAttribute("ImageGeometry", &isImageGeometry))
+  if (tinyxml2::XML_SUCCESS != geometryElement->QueryBoolAttribute("ImageGeometry", &isImageGeometry))
   {
     MITK_WARN << "Missing bool ImageGeometry for Geometry3D.";
   }
 
   // matrix
-  if (TiXmlElement *matrixElem = geometryElement->FirstChildElement("IndexToWorld")->ToElement())
+  if (auto *matrixElem = geometryElement->FirstChildElement("IndexToWorld"))
   {
     bool matrixComplete = true;
     for (unsigned int r = 0; r < 3; ++r)
     {
       for (unsigned int c = 0; c < 3; ++c)
       {
         std::stringstream element_namer;
         element_namer << "m_" << r << "_" << c;
 
-        std::string string_value;
-        if (TIXML_SUCCESS == matrixElem->QueryStringAttribute(element_namer.str().c_str(), &string_value))
+        const char* string_value = matrixElem->Attribute(element_namer.str().c_str());
+        if (nullptr != string_value)
         {
           try
           {
             matrix[r][c] = boost::lexical_cast<double>(string_value);
           }
           catch ( const boost::bad_lexical_cast &e )
           {
             MITK_ERROR << "Could not parse '" << string_value << "' as number: " << e.what();
             return nullptr;
           }
         }
         else
         {
           matrixComplete = false;
         }
       }
     }
 
     if (!matrixComplete)
     {
       MITK_ERROR << "Could not parse all Geometry3D matrix coefficients!";
       return nullptr;
     }
   }
   else
   {
     MITK_ERROR << "Parse error: expected Matrix3x3 child below Geometry3D node";
     return nullptr;
   }
 
   // offset
-  if (TiXmlElement *offsetElem = geometryElement->FirstChildElement("Offset")->ToElement())
+  if (auto *offsetElem = geometryElement->FirstChildElement("Offset"))
   {
-    bool vectorComplete = true;
-    std::string offset_string[3];
-    vectorComplete &= TIXML_SUCCESS == offsetElem->QueryStringAttribute("x", &offset_string[0]);
-    vectorComplete &= TIXML_SUCCESS == offsetElem->QueryStringAttribute("y", &offset_string[1]);
-    vectorComplete &= TIXML_SUCCESS == offsetElem->QueryStringAttribute("z", &offset_string[2]);
+    std::array<const char*, 3> offset_string = {
+      offsetElem->Attribute("x"),
+      offsetElem->Attribute("y"),
+      offsetElem->Attribute("z")
+    };
 
-    if (!vectorComplete)
+    if (nullptr == offset_string[0] || nullptr == offset_string[1] || nullptr == offset_string[2])
     {
       MITK_ERROR << "Could not parse complete Geometry3D offset!";
       return nullptr;
     }
 
     for (unsigned int d = 0; d < 3; ++d)
       try
       {
         offset[d] = boost::lexical_cast<double>(offset_string[d]);
       }
       catch ( const boost::bad_lexical_cast &e )
       {
         MITK_ERROR << "Could not parse '" << offset_string[d] << "' as number: " << e.what();
         return nullptr;
       }
   }
   else
   {
     MITK_ERROR << "Parse error: expected Offset3D child below Geometry3D node";
     return nullptr;
   }
 
   // bounds
-  if (TiXmlElement *boundsElem = geometryElement->FirstChildElement("Bounds")->ToElement())
+  if (auto *boundsElem = geometryElement->FirstChildElement("Bounds"))
   {
-    bool vectorsComplete(true);
-    std::string bounds_string[6];
-    if (TiXmlElement *minElem = boundsElem->FirstChildElement("Min")->ToElement())
+    bool vectorsComplete;
+    std::array<const char*, 6> bounds_string;
+    if (auto* minElem = boundsElem->FirstChildElement("Min"))
     {
-      vectorsComplete &= TIXML_SUCCESS == minElem->QueryStringAttribute("x", &bounds_string[0]);
-      vectorsComplete &= TIXML_SUCCESS == minElem->QueryStringAttribute("y", &bounds_string[2]);
-      vectorsComplete &= TIXML_SUCCESS == minElem->QueryStringAttribute("z", &bounds_string[4]);
+      bounds_string[0] = minElem->Attribute("x");
+      bounds_string[2] = minElem->Attribute("y");
+      bounds_string[4] = minElem->Attribute("z");
+
+      vectorsComplete = !(nullptr == bounds_string[0] || nullptr == bounds_string[2] || nullptr == bounds_string[4]);
     }
     else
     {
       vectorsComplete = false;
     }
 
-    if (TiXmlElement *maxElem = boundsElem->FirstChildElement("Max")->ToElement())
+    if (auto *maxElem = boundsElem->FirstChildElement("Max"))
     {
-      vectorsComplete &= TIXML_SUCCESS == maxElem->QueryStringAttribute("x", &bounds_string[1]);
-      vectorsComplete &= TIXML_SUCCESS == maxElem->QueryStringAttribute("y", &bounds_string[3]);
-      vectorsComplete &= TIXML_SUCCESS == maxElem->QueryStringAttribute("z", &bounds_string[5]);
+      bounds_string[1] = maxElem->Attribute("x");
+      bounds_string[3] = maxElem->Attribute("y");
+      bounds_string[5] = maxElem->Attribute("z");
+
+      vectorsComplete = !(nullptr == bounds_string[1] || nullptr == bounds_string[3] || nullptr == bounds_string[5]);
     }
     else
     {
       vectorsComplete = false;
     }
 
     if (!vectorsComplete)
     {
       MITK_ERROR << "Could not parse complete Geometry3D bounds!";
       return nullptr;
     }
 
     for (unsigned int d = 0; d < 6; ++d)
       try
       {
         bounds[d] = boost::lexical_cast<double>(bounds_string[d]);
       }
       catch ( const boost::bad_lexical_cast &e )
       {
         MITK_ERROR << "Could not parse '" << bounds_string[d] << "' as number: " << e.what();
         return nullptr;
       }
   }
 
   // build GeometryData from matrix/offset
   AffineTransform3D::Pointer newTransform = AffineTransform3D::New();
   newTransform->SetMatrix(matrix);
   newTransform->SetOffset(offset);
 
   Geometry3D::Pointer newGeometry = Geometry3D::New();
   newGeometry->SetFrameOfReferenceID(frameOfReferenceID);
   newGeometry->SetImageGeometry(isImageGeometry);
 
   newGeometry->SetIndexToWorldTransform(newTransform);
 
   newGeometry->SetBounds(bounds);
 
   return newGeometry;
 }
diff --git a/Modules/Core/src/IO/mitkGeometry3DToXML.h b/Modules/Core/src/IO/mitkGeometry3DToXML.h
index d0cd9d0f6d..ef3a2454eb 100644
--- a/Modules/Core/src/IO/mitkGeometry3DToXML.h
+++ b/Modules/Core/src/IO/mitkGeometry3DToXML.h
@@ -1,51 +1,55 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkGeometry3DToXML_h
 #define mitkGeometry3DToXML_h
 
 // MITK
 #include "mitkGeometry3D.h"
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
    * @internal
    *
    * @brief Helper for Geometry3D related I/O classes.
    *
    * Creates TinyXML elements (blocks) that describe a Geometry3D.
    * Also offers a method to read such blocks and create a corresponding Geometry3D.
    *
    * @sa GeometryDataReaderService, GeometryDataWriterService, PointSetWriterService, PointSetReaderService
    *
    * @ingroup IO
    */
   class Geometry3DToXML
   {
   public:
     /**
      * @brief Serialize given geometry to XML.
      */
-    static TiXmlElement *ToXML(const Geometry3D *geometry);
+    static tinyxml2::XMLElement *ToXML(tinyxml2::XMLDocument& doc, const Geometry3D *geometry);
 
     /**
      * @brief Create a Geometry3D from XML.
      * Interprets only the format created by ToXML().
      */
-    static Geometry3D::Pointer FromXML(TiXmlElement *node);
+    static Geometry3D::Pointer FromXML(const tinyxml2::XMLElement *node);
   };
 }
 
 #endif
diff --git a/Modules/Core/src/IO/mitkGeometryDataReaderService.cpp b/Modules/Core/src/IO/mitkGeometryDataReaderService.cpp
index 0b13ffe89c..8731ae70e8 100644
--- a/Modules/Core/src/IO/mitkGeometryDataReaderService.cpp
+++ b/Modules/Core/src/IO/mitkGeometryDataReaderService.cpp
@@ -1,112 +1,113 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkGeometryDataReaderService.h"
 #include "mitkGeometry3DToXML.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkProportionalTimeGeometryToXML.h"
 
 // STL
 #include <mitkLocaleSwitch.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 mitk::GeometryDataReaderService::GeometryDataReaderService()
   : AbstractFileReader(IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), "MITK Geometry Data Reader")
 {
   RegisterService();
 }
 
 mitk::GeometryDataReaderService::~GeometryDataReaderService()
 {
 }
 
 std::vector<itk::SmartPointer<mitk::BaseData>> mitk::GeometryDataReaderService::DoRead()
 {
   // Switch the current locale to "C"
   LocaleSwitch localeSwitch("C");
 
   std::vector<itk::SmartPointer<BaseData>> result;
 
   InputStream stream(this);
 
-  TiXmlDocument doc;
-  stream >> doc;
+  std::string s(std::istreambuf_iterator<char>{stream.rdbuf()}, std::istreambuf_iterator<char>());
+  tinyxml2::XMLDocument doc;
+  doc.Parse(s.c_str(), s.size());
   if (!doc.Error())
   {
-    TiXmlHandle docHandle(&doc);
+    tinyxml2::XMLHandle docHandle(&doc);
 
-    for (TiXmlElement *geomDataElement = docHandle.FirstChildElement("GeometryData").ToElement();
+    for (auto *geomDataElement = docHandle.FirstChildElement("GeometryData").ToElement();
          geomDataElement != nullptr;
          geomDataElement = geomDataElement->NextSiblingElement())
     {
-      for (TiXmlElement *currentElement = geomDataElement->FirstChildElement(); currentElement != nullptr;
+      for (auto *currentElement = geomDataElement->FirstChildElement(); currentElement != nullptr;
            currentElement = currentElement->NextSiblingElement())
       {
         // different geometries could have been serialized from a GeometryData
         // object:
         std::string tagName = currentElement->Value();
         if (tagName == "Geometry3D")
         {
           Geometry3D::Pointer restoredGeometry = Geometry3DToXML::FromXML(currentElement);
           if (restoredGeometry.IsNotNull())
           {
             GeometryData::Pointer newGeometryData = GeometryData::New();
             newGeometryData->SetGeometry(restoredGeometry);
             result.push_back(newGeometryData.GetPointer());
           }
           else
           {
             MITK_ERROR << "Invalid <Geometry3D> tag encountered. Skipping.";
           }
         }
         else if (tagName == "ProportionalTimeGeometry")
         {
           ProportionalTimeGeometry::Pointer restoredTimeGeometry =
             ProportionalTimeGeometryToXML::FromXML(currentElement);
           if (restoredTimeGeometry.IsNotNull())
           {
             GeometryData::Pointer newGeometryData = GeometryData::New();
             newGeometryData->SetTimeGeometry(restoredTimeGeometry);
             result.push_back(newGeometryData.GetPointer());
           }
           else
           {
             MITK_ERROR << "Invalid <ProportionalTimeGeometry> tag encountered. Skipping.";
           }
         }
       } // for child of <GeometryData>
     }   // for <GeometryData>
   }
   else
   {
-    mitkThrow() << "Parsing error at line " << doc.ErrorRow() << ", col " << doc.ErrorCol() << ": " << doc.ErrorDesc();
+    mitkThrow() << doc.ErrorStr();
   }
 
   if (result.empty())
   {
     mitkThrow() << "Did not read a single GeometryData object from input.";
   }
 
   return result;
 }
 
 mitk::GeometryDataReaderService::GeometryDataReaderService(const mitk::GeometryDataReaderService &other)
   : mitk::AbstractFileReader(other)
 {
 }
 
 mitk::GeometryDataReaderService *mitk::GeometryDataReaderService::Clone() const
 {
   return new GeometryDataReaderService(*this);
 }
diff --git a/Modules/Core/src/IO/mitkGeometryDataWriterService.cpp b/Modules/Core/src/IO/mitkGeometryDataWriterService.cpp
index 1ca99cb8d0..57f02597a9 100644
--- a/Modules/Core/src/IO/mitkGeometryDataWriterService.cpp
+++ b/Modules/Core/src/IO/mitkGeometryDataWriterService.cpp
@@ -1,91 +1,90 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkGeometryDataWriterService.h"
 #include "mitkIOMimeTypes.h"
 
 #include "mitkProportionalTimeGeometryToXML.h"
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 #include <mitkLocaleSwitch.h>
 
 mitk::GeometryDataWriterService::GeometryDataWriterService()
   : AbstractFileWriter(
       GeometryData::GetStaticNameOfClass(), IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), "MITK Geometry Data Writer")
 {
   RegisterService();
 }
 
 mitk::GeometryDataWriterService::GeometryDataWriterService(const mitk::GeometryDataWriterService &other)
   : AbstractFileWriter(other)
 {
 }
 
 mitk::GeometryDataWriterService::~GeometryDataWriterService()
 {
 }
 
 void mitk::GeometryDataWriterService::Write()
 {
   /* using the stream interface produces files without line breaks or indentation..
      But before changing to file interface, need to understand the new I/O classes */
   OutputStream out(this);
 
   if (!out.good())
   {
     mitkThrow() << "Stream not good.";
   }
 
   // Switch the current locale to "C"
   LocaleSwitch localeSwitch("C");
 
   // Open XML file using TinyXML,
   // loop over all inputs,
   //   call appropriate serializing functions
 
-  TiXmlDocument doc;
+  tinyxml2::XMLDocument doc;
+  doc.InsertEndChild(doc.NewDeclaration());
 
-  auto *decl = new TiXmlDeclaration(
-    "1.0", "UTF-8", ""); // TODO what to write here? encoding? standalone would mean that we provide a DTD somewhere...
-  doc.LinkEndChild(decl);
-
-  auto *rootNode = new TiXmlElement("GeometryData");
-  doc.LinkEndChild(rootNode);
+  auto* rootNode = doc.NewElement("GeometryData");
+  doc.InsertEndChild(rootNode);
 
   // note version info
-  auto *version = new TiXmlElement("Version");
+  auto *version = doc.NewElement("Version");
   version->SetAttribute("Writer", __FILE__);
   version->SetAttribute("FileVersion", 1);
-  rootNode->LinkEndChild(version);
+  rootNode->InsertEndChild(version);
 
   const auto *data = static_cast<const GeometryData *>(this->GetInput());
 
   const ProportionalTimeGeometry *timeGeometry(nullptr);
   if ((timeGeometry = dynamic_cast<const ProportionalTimeGeometry *>(data->GetTimeGeometry())))
   {
-    TiXmlElement *timeGeometryElement = ProportionalTimeGeometryToXML::ToXML(timeGeometry);
-    rootNode->LinkEndChild(timeGeometryElement);
+    auto *timeGeometryElement = ProportionalTimeGeometryToXML::ToXML(doc, timeGeometry);
+    rootNode->InsertEndChild(timeGeometryElement);
   }
   else
   {
     MITK_WARN << "Serializing GeometryData that does not have a valid ProportionalTimeGeometry! Not implemented!";
   }
 
   // Write out document
-  out << doc;
+  tinyxml2::XMLPrinter printer;
+  doc.Print(&printer);
+  out << printer.CStr();
 }
 
 mitk::GeometryDataWriterService *mitk::GeometryDataWriterService::Clone() const
 {
   return new GeometryDataWriterService(*this);
 }
diff --git a/Modules/Core/src/IO/mitkPointSetReaderService.cpp b/Modules/Core/src/IO/mitkPointSetReaderService.cpp
index 68cc84f562..63d3018782 100644
--- a/Modules/Core/src/IO/mitkPointSetReaderService.cpp
+++ b/Modules/Core/src/IO/mitkPointSetReaderService.cpp
@@ -1,275 +1,276 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkPointSetReaderService.h"
 #include "mitkGeometry3DToXML.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkProportionalTimeGeometry.h"
+#include <mitkLocaleSwitch.h>
 
 // STL
 #include <fstream>
 #include <iostream>
-#include <mitkLocaleSwitch.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 mitk::PointSetReaderService::PointSetReaderService()
   : AbstractFileReader(CustomMimeType(IOMimeTypes::POINTSET_MIMETYPE()), "MITK Point Set Reader")
 {
   RegisterService();
 }
 
 mitk::PointSetReaderService::~PointSetReaderService()
 {
 }
 
 std::vector<itk::SmartPointer<mitk::BaseData>> mitk::PointSetReaderService::DoRead()
 {
   // Switch the current locale to "C"
   LocaleSwitch localeSwitch("C");
 
   std::vector<itk::SmartPointer<mitk::BaseData>> result;
 
   InputStream stream(this);
 
-  TiXmlDocument doc;
-  stream >> doc;
+  std::string s(std::istreambuf_iterator<char>{stream.rdbuf()}, std::istreambuf_iterator<char>());
+  tinyxml2::XMLDocument doc;
+  doc.Parse(s.c_str(), s.size());
   if (!doc.Error())
   {
-    TiXmlHandle docHandle(&doc);
+    tinyxml2::XMLHandle docHandle(&doc);
     // unsigned int pointSetCounter(0);
-    for (TiXmlElement *currentPointSetElement =
+    for (auto *currentPointSetElement =
            docHandle.FirstChildElement("point_set_file").FirstChildElement("point_set").ToElement();
          currentPointSetElement != nullptr;
          currentPointSetElement = currentPointSetElement->NextSiblingElement())
     {
       mitk::PointSet::Pointer newPointSet = mitk::PointSet::New();
 
       // time geometry assembled for addition after all points
       // else the SetPoint method would already transform the points that we provide it
       mitk::ProportionalTimeGeometry::Pointer timeGeometry = mitk::ProportionalTimeGeometry::New();
 
       if (currentPointSetElement->FirstChildElement("time_series") != nullptr)
       {
-        for (TiXmlElement *currentTimeSeries = currentPointSetElement->FirstChildElement("time_series")->ToElement();
+        for (auto *currentTimeSeries = currentPointSetElement->FirstChildElement("time_series")->ToElement();
              currentTimeSeries != nullptr;
              currentTimeSeries = currentTimeSeries->NextSiblingElement())
         {
           unsigned int currentTimeStep(0);
-          TiXmlElement *currentTimeSeriesID = currentTimeSeries->FirstChildElement("time_series_id");
+          auto *currentTimeSeriesID = currentTimeSeries->FirstChildElement("time_series_id");
 
           currentTimeStep = atoi(currentTimeSeriesID->GetText());
 
           timeGeometry->Expand(currentTimeStep + 1); // expand (default to identity) in any case
-          TiXmlElement *geometryElem = currentTimeSeries->FirstChildElement("Geometry3D");
+          auto *geometryElem = currentTimeSeries->FirstChildElement("Geometry3D");
           if (geometryElem)
           {
             Geometry3D::Pointer geometry = Geometry3DToXML::FromXML(geometryElem);
             if (geometry.IsNotNull())
             {
               timeGeometry->SetTimeStepGeometry(geometry, currentTimeStep);
             }
             else
             {
               MITK_ERROR << "Could not deserialize Geometry3D element.";
             }
           }
           else
           {
             MITK_WARN << "Fallback to legacy behavior: defining PointSet geometry as identity";
           }
 
           newPointSet = this->ReadPoints(newPointSet, currentTimeSeries, currentTimeStep);
         }
       }
       else
       {
         newPointSet = this->ReadPoints(newPointSet, currentPointSetElement, 0);
       }
 
       newPointSet->SetTimeGeometry(timeGeometry);
 
       result.push_back(newPointSet.GetPointer());
     }
   }
   else
   {
-    mitkThrow() << "Parsing error at line " << doc.ErrorRow() << ", col " << doc.ErrorCol() << ": " << doc.ErrorDesc();
+    mitkThrow() << doc.ErrorStr();
   }
 
   return result;
 }
 
-mitk::BaseGeometry::Pointer mitk::PointSetReaderService::ReadGeometry(TiXmlElement *parentElement)
+mitk::BaseGeometry::Pointer mitk::PointSetReaderService::ReadGeometry(tinyxml2::XMLElement *parentElement)
 {
-  TiXmlElement *geometryElem = parentElement->FirstChildElement("geometry3d");
+  auto *geometryElem = parentElement->FirstChildElement("geometry3d");
   if (!geometryElem)
     return nullptr;
 
   // data to generate
   AffineTransform3D::MatrixType matrix;
   AffineTransform3D::OffsetType offset;
   bool isImageGeometry(false);
   unsigned int frameOfReferenceID(0);
   BaseGeometry::BoundsArrayType bounds;
 
   bool somethingMissing(false);
 
   // find data in xml structure
-  TiXmlElement *imageGeometryElem = geometryElem->FirstChildElement("image_geometry");
+  auto *imageGeometryElem = geometryElem->FirstChildElement("image_geometry");
   if (imageGeometryElem)
   {
     std::string igs = imageGeometryElem->GetText();
     isImageGeometry = igs == "true" || igs == "TRUE" || igs == "1";
   }
   else
     somethingMissing = true;
 
-  TiXmlElement *frameOfReferenceElem = geometryElem->FirstChildElement("frame_of_reference_id");
+  auto *frameOfReferenceElem = geometryElem->FirstChildElement("frame_of_reference_id");
   if (frameOfReferenceElem)
   {
     frameOfReferenceID = atoi(frameOfReferenceElem->GetText());
   }
   else
     somethingMissing = true;
 
-  TiXmlElement *indexToWorldElem = geometryElem->FirstChildElement("index_to_world");
+  auto *indexToWorldElem = geometryElem->FirstChildElement("index_to_world");
   if (indexToWorldElem)
   {
-    TiXmlElement *matrixElem = indexToWorldElem->FirstChildElement("matrix3x3");
-    TiXmlElement *offsetElem = indexToWorldElem->FirstChildElement("offset");
+    auto *matrixElem = indexToWorldElem->FirstChildElement("matrix3x3");
+    auto *offsetElem = indexToWorldElem->FirstChildElement("offset");
     if (indexToWorldElem && offsetElem)
     {
-      TiXmlElement *col0 = matrixElem->FirstChildElement("column_0");
-      TiXmlElement *col1 = matrixElem->FirstChildElement("column_1");
-      TiXmlElement *col2 = matrixElem->FirstChildElement("column_2");
+      auto*col0 = matrixElem->FirstChildElement("column_0");
+      auto*col1 = matrixElem->FirstChildElement("column_1");
+      auto*col2 = matrixElem->FirstChildElement("column_2");
 
       if (col0 && col1 && col2)
       {
-        somethingMissing |= TIXML_SUCCESS != col0->QueryDoubleAttribute("x", &matrix[0][0]);
-        somethingMissing |= TIXML_SUCCESS != col0->QueryDoubleAttribute("y", &matrix[1][0]);
-        somethingMissing |= TIXML_SUCCESS != col0->QueryDoubleAttribute("z", &matrix[2][0]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col0->QueryDoubleAttribute("x", &matrix[0][0]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col0->QueryDoubleAttribute("y", &matrix[1][0]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col0->QueryDoubleAttribute("z", &matrix[2][0]);
 
-        somethingMissing |= TIXML_SUCCESS != col1->QueryDoubleAttribute("x", &matrix[0][1]);
-        somethingMissing |= TIXML_SUCCESS != col1->QueryDoubleAttribute("y", &matrix[1][1]);
-        somethingMissing |= TIXML_SUCCESS != col1->QueryDoubleAttribute("z", &matrix[2][1]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col1->QueryDoubleAttribute("x", &matrix[0][1]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col1->QueryDoubleAttribute("y", &matrix[1][1]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col1->QueryDoubleAttribute("z", &matrix[2][1]);
 
-        somethingMissing |= TIXML_SUCCESS != col2->QueryDoubleAttribute("x", &matrix[0][2]);
-        somethingMissing |= TIXML_SUCCESS != col2->QueryDoubleAttribute("y", &matrix[1][2]);
-        somethingMissing |= TIXML_SUCCESS != col2->QueryDoubleAttribute("z", &matrix[2][2]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col2->QueryDoubleAttribute("x", &matrix[0][2]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col2->QueryDoubleAttribute("y", &matrix[1][2]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != col2->QueryDoubleAttribute("z", &matrix[2][2]);
       }
       else
         somethingMissing = true;
 
-      somethingMissing |= TIXML_SUCCESS != offsetElem->QueryDoubleAttribute("x", &offset[0]);
-      somethingMissing |= TIXML_SUCCESS != offsetElem->QueryDoubleAttribute("y", &offset[1]);
-      somethingMissing |= TIXML_SUCCESS != offsetElem->QueryDoubleAttribute("z", &offset[2]);
+      somethingMissing |= tinyxml2::XML_SUCCESS != offsetElem->QueryDoubleAttribute("x", &offset[0]);
+      somethingMissing |= tinyxml2::XML_SUCCESS != offsetElem->QueryDoubleAttribute("y", &offset[1]);
+      somethingMissing |= tinyxml2::XML_SUCCESS != offsetElem->QueryDoubleAttribute("z", &offset[2]);
     }
     else
       somethingMissing = true;
 
-    TiXmlElement *boundsElem = geometryElem->FirstChildElement("bounds");
+    auto *boundsElem = geometryElem->FirstChildElement("bounds");
     if (boundsElem)
     {
-      TiXmlElement *minBoundsElem = boundsElem->FirstChildElement("min");
-      TiXmlElement *maxBoundsElem = boundsElem->FirstChildElement("max");
+      auto *minBoundsElem = boundsElem->FirstChildElement("min");
+      auto *maxBoundsElem = boundsElem->FirstChildElement("max");
 
       if (minBoundsElem && maxBoundsElem)
       {
-        somethingMissing |= TIXML_SUCCESS != minBoundsElem->QueryDoubleAttribute("x", &bounds[0]);
-        somethingMissing |= TIXML_SUCCESS != minBoundsElem->QueryDoubleAttribute("y", &bounds[2]);
-        somethingMissing |= TIXML_SUCCESS != minBoundsElem->QueryDoubleAttribute("z", &bounds[4]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != minBoundsElem->QueryDoubleAttribute("x", &bounds[0]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != minBoundsElem->QueryDoubleAttribute("y", &bounds[2]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != minBoundsElem->QueryDoubleAttribute("z", &bounds[4]);
 
-        somethingMissing |= TIXML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("x", &bounds[1]);
-        somethingMissing |= TIXML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("y", &bounds[3]);
-        somethingMissing |= TIXML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("z", &bounds[5]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("x", &bounds[1]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("y", &bounds[3]);
+        somethingMissing |= tinyxml2::XML_SUCCESS != maxBoundsElem->QueryDoubleAttribute("z", &bounds[5]);
       }
       else
         somethingMissing = true;
     }
     else
       somethingMissing = true;
   }
   else
     somethingMissing = true;
 
   if (somethingMissing)
   {
     MITK_ERROR << "XML structure of geometry inside a PointSet file broken. Refusing to build Geometry3D";
     return nullptr;
   }
   else
   {
     Geometry3D::Pointer g = Geometry3D::New();
     g->SetImageGeometry(isImageGeometry);
     g->SetFrameOfReferenceID(frameOfReferenceID);
     g->SetBounds(bounds);
 
     AffineTransform3D::Pointer transform = AffineTransform3D::New();
     transform->SetMatrix(matrix);
     transform->SetOffset(offset);
 
     g->SetIndexToWorldTransform(transform);
 
     return g.GetPointer();
   }
 }
 
 mitk::PointSet::Pointer mitk::PointSetReaderService::ReadPoints(mitk::PointSet::Pointer newPointSet,
-                                                                TiXmlElement *currentTimeSeries,
+                                                                tinyxml2::XMLElement *currentTimeSeries,
                                                                 unsigned int currentTimeStep)
 {
   if (currentTimeSeries->FirstChildElement("point") != nullptr)
   {
-    for (TiXmlElement *currentPoint = currentTimeSeries->FirstChildElement("point")->ToElement(); currentPoint != nullptr;
+    for (auto *currentPoint = currentTimeSeries->FirstChildElement("point"); currentPoint != nullptr;
          currentPoint = currentPoint->NextSiblingElement())
     {
       unsigned int id(0);
       auto spec((mitk::PointSpecificationType)0);
       double x(0.0);
       double y(0.0);
       double z(0.0);
 
       id = atoi(currentPoint->FirstChildElement("id")->GetText());
       if (currentPoint->FirstChildElement("specification") != nullptr)
       {
         spec = (mitk::PointSpecificationType)atoi(currentPoint->FirstChildElement("specification")->GetText());
       }
       x = atof(currentPoint->FirstChildElement("x")->GetText());
       y = atof(currentPoint->FirstChildElement("y")->GetText());
       z = atof(currentPoint->FirstChildElement("z")->GetText());
 
       mitk::Point3D point;
       mitk::FillVector3D(point, x, y, z);
       newPointSet->SetPoint(id, point, spec, currentTimeStep);
     }
   }
   else
   {
     if (currentTimeStep != newPointSet->GetTimeSteps() + 1)
     {
       newPointSet->Expand(currentTimeStep + 1); // expand time step series with empty time step
     }
   }
   return newPointSet;
 }
 
 mitk::PointSetReaderService::PointSetReaderService(const mitk::PointSetReaderService &other)
   : mitk::AbstractFileReader(other)
 {
 }
 
 mitk::PointSetReaderService *mitk::PointSetReaderService::Clone() const
 {
   return new mitk::PointSetReaderService(*this);
 }
diff --git a/Modules/Core/src/IO/mitkPointSetReaderService.h b/Modules/Core/src/IO/mitkPointSetReaderService.h
index 5aba51b592..f72bc23fdb 100644
--- a/Modules/Core/src/IO/mitkPointSetReaderService.h
+++ b/Modules/Core/src/IO/mitkPointSetReaderService.h
@@ -1,62 +1,65 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef _MITK_POINT_SET_READER_SERVICE__H_
 #define _MITK_POINT_SET_READER_SERVICE__H_
 
 // MITK
 #include <mitkAbstractFileReader.h>
 #include <mitkPointSet.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
    * @internal
    *
    * @brief reads xml representations of mitk::PointSets from a file
    *
    * Reader for xml files containing one or multiple xml represenations of
    * mitk::PointSet. If multiple mitk::PointSet objects are stored in one file,
    * these are assigned to multiple BaseData objects.
    *
    * The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D
    * Pointsets.
    *
    * @ingroup IO
    */
   class PointSetReaderService : public AbstractFileReader
   {
   public:
     PointSetReaderService();
     ~PointSetReaderService() override;
 
     using AbstractFileReader::Read;
 
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
   private:
     PointSetReaderService(const PointSetReaderService &other);
 
-    mitk::BaseGeometry::Pointer ReadGeometry(TiXmlElement *parentElement);
+    mitk::BaseGeometry::Pointer ReadGeometry(tinyxml2::XMLElement *parentElement);
 
     mitk::PointSet::Pointer ReadPoints(mitk::PointSet::Pointer newPointSet,
-                                       TiXmlElement *currentTimeSeries,
+                                       tinyxml2::XMLElement *currentTimeSeries,
                                        unsigned int currentTimeStep);
 
     PointSetReaderService *Clone() const override;
   };
 }
 
 #endif
diff --git a/Modules/Core/src/IO/mitkPointSetWriterService.cpp b/Modules/Core/src/IO/mitkPointSetWriterService.cpp
index 30a5d25dcc..63e99ad061 100644
--- a/Modules/Core/src/IO/mitkPointSetWriterService.cpp
+++ b/Modules/Core/src/IO/mitkPointSetWriterService.cpp
@@ -1,182 +1,179 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPointSetWriterService.h"
 #include "mitkGeometry3DToXML.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkLocaleSwitch.h"
 
 #include "mitkGeometry3D.h"
 
-#include <tinyxml.h>
-
 #include <fstream>
 #include <iostream>
 #include <locale>
 
+#include <tinyxml2.h>
+
 //
 // Initialization of the xml tags.
 //
 const std::string mitk::PointSetWriterService::XML_POINT_SET_FILE = "point_set_file";
 const std::string mitk::PointSetWriterService::XML_FILE_VERSION = "file_version";
 const std::string mitk::PointSetWriterService::XML_POINT_SET = "point_set";
 const std::string mitk::PointSetWriterService::XML_TIME_SERIES = "time_series";
 const std::string mitk::PointSetWriterService::XML_TIME_SERIES_ID = "time_series_id";
 const std::string mitk::PointSetWriterService::XML_POINT = "point";
 const std::string mitk::PointSetWriterService::XML_ID = "id";
 const std::string mitk::PointSetWriterService::XML_SPEC = "specification";
 const std::string mitk::PointSetWriterService::XML_X = "x";
 const std::string mitk::PointSetWriterService::XML_Y = "y";
 const std::string mitk::PointSetWriterService::XML_Z = "z";
 const std::string mitk::PointSetWriterService::VERSION_STRING = "0.1";
 
 mitk::PointSetWriterService::PointSetWriterService()
   : AbstractFileWriter(
       PointSet::GetStaticNameOfClass(), CustomMimeType(IOMimeTypes::POINTSET_MIMETYPE()), "MITK Point Set Writer")
 {
   RegisterService();
 }
 
 mitk::PointSetWriterService::PointSetWriterService(const mitk::PointSetWriterService &other) : AbstractFileWriter(other)
 {
 }
 
 mitk::PointSetWriterService::~PointSetWriterService()
 {
 }
 
 void mitk::PointSetWriterService::Write()
 {
   mitk::LocaleSwitch localeC("C");
 
-  TiXmlDocument doc;
-
-  auto *decl = new TiXmlDeclaration(
-    "1.0", "UTF-8", ""); // TODO what to write here? encoding? standalone would mean that we provide a DTD somewhere...
-  doc.LinkEndChild(decl);
+  tinyxml2::XMLDocument doc;
+  doc.InsertEndChild(doc.NewDeclaration());
 
-  auto *rootNode = new TiXmlElement(XML_POINT_SET_FILE);
-  doc.LinkEndChild(rootNode);
+  auto *rootNode = doc.NewElement(XML_POINT_SET_FILE.c_str());
+  doc.InsertEndChild(rootNode);
 
-  auto *versionNode = new TiXmlElement(XML_FILE_VERSION);
-  auto *versionText = new TiXmlText(VERSION_STRING);
-  versionNode->LinkEndChild(versionText);
-  rootNode->LinkEndChild(versionNode);
+  auto *versionNode = doc.NewElement(XML_FILE_VERSION.c_str());
+  auto *versionText = doc.NewText(VERSION_STRING.c_str());
+  versionNode->InsertEndChild(versionText);
+  rootNode->InsertEndChild(versionNode);
 
-  TiXmlElement *pointSetNode = ToXML(static_cast<const PointSet *>(this->GetInput()));
+  auto *pointSetNode = ToXML(doc, static_cast<const PointSet *>(this->GetInput()));
   if (!pointSetNode)
   {
     mitkThrow() << "Serialization error during PointSet writing.";
   }
-  rootNode->LinkEndChild(pointSetNode);
+  rootNode->InsertEndChild(pointSetNode);
 
   // out << doc; // streaming of TinyXML write no new-lines,
   // rendering XML files unreadable (for humans)
 
   LocalFile f(this);
-  if (!doc.SaveFile(f.GetFileName()))
+  if (tinyxml2::XML_SUCCESS != doc.SaveFile(f.GetFileName().c_str()))
   {
     mitkThrow() << "Some error during point set writing.";
   }
 }
 
 mitk::PointSetWriterService *mitk::PointSetWriterService::Clone() const
 {
   return new PointSetWriterService(*this);
 }
 
-TiXmlElement *mitk::PointSetWriterService::ToXML(const mitk::PointSet *pointSet)
+tinyxml2::XMLElement *mitk::PointSetWriterService::ToXML(tinyxml2::XMLDocument& doc, const mitk::PointSet *pointSet)
 {
   // the following is rather bloated and could be expressed in more compact XML
   // (e.g. using attributes instead of tags for x/y/z). The current format is
   // kept to be compatible with the previous writer.
-  auto *pointSetElement = new TiXmlElement(XML_POINT_SET);
+  auto *pointSetElement = doc.NewElement(XML_POINT_SET.c_str());
   unsigned int timecount = pointSet->GetTimeSteps();
 
   for (unsigned int i = 0; i < timecount; i++)
   {
-    auto *timeSeriesElement = new TiXmlElement(XML_TIME_SERIES);
-    pointSetElement->LinkEndChild(timeSeriesElement);
+    auto *timeSeriesElement = doc.NewElement(XML_TIME_SERIES.c_str());
+    pointSetElement->InsertEndChild(timeSeriesElement);
 
-    auto *timeSeriesIDElement = new TiXmlElement(XML_TIME_SERIES_ID);
-    timeSeriesElement->LinkEndChild(timeSeriesIDElement);
-    TiXmlText *timeSeriesIDText = new TiXmlText(ConvertToString(i));
-    timeSeriesIDElement->LinkEndChild(timeSeriesIDText);
+    auto *timeSeriesIDElement = doc.NewElement(XML_TIME_SERIES_ID.c_str());
+    timeSeriesElement->InsertEndChild(timeSeriesIDElement);
+    auto *timeSeriesIDText = doc.NewText(ConvertToString(i).c_str());
+    timeSeriesIDElement->InsertEndChild(timeSeriesIDText);
 
     PointSet::PointsContainer *pointsContainer = pointSet->GetPointSet(i)->GetPoints();
     PointSet::PointsContainer::Iterator it;
 
     auto *geometry = dynamic_cast<Geometry3D *>(pointSet->GetGeometry(i));
     if (geometry == nullptr)
     {
       MITK_WARN << "Writing a PointSet with something other that a Geometry3D. This is not foreseen and not handled.";
       // we'll continue anyway, this imitates previous behavior
     }
     else
     {
-      TiXmlElement *geometryElement = Geometry3DToXML::ToXML(geometry);
-      timeSeriesElement->LinkEndChild(geometryElement);
+      auto *geometryElement = Geometry3DToXML::ToXML(doc, geometry);
+      timeSeriesElement->InsertEndChild(geometryElement);
     }
 
     for (it = pointsContainer->Begin(); it != pointsContainer->End(); ++it)
     {
-      auto *pointElement = new TiXmlElement(XML_POINT);
-      timeSeriesElement->LinkEndChild(pointElement);
+      auto *pointElement = doc.NewElement(XML_POINT.c_str());
+      timeSeriesElement->InsertEndChild(pointElement);
 
-      auto *pointIDElement = new TiXmlElement(XML_ID);
-      TiXmlText *pointIDText = new TiXmlText(ConvertToString(it->Index()));
-      pointIDElement->LinkEndChild(pointIDText);
-      pointElement->LinkEndChild(pointIDElement);
+      auto *pointIDElement = doc.NewElement(XML_ID.c_str());
+      auto *pointIDText = doc.NewText(ConvertToString(it->Index()).c_str());
+      pointIDElement->InsertEndChild(pointIDText);
+      pointElement->InsertEndChild(pointIDElement);
 
       mitk::PointSet::PointType point = it->Value();
 
-      auto *pointSpecElement = new TiXmlElement(XML_SPEC);
-      TiXmlText *pointSpecText = new TiXmlText(ConvertToString(pointSet->GetSpecificationTypeInfo(it->Index(), i)));
-      pointSpecElement->LinkEndChild(pointSpecText);
-      pointElement->LinkEndChild(pointSpecElement);
-
-      auto *pointXElement = new TiXmlElement(XML_X);
-      TiXmlText *pointXText = new TiXmlText(ConvertToString(point[0]));
-      pointXElement->LinkEndChild(pointXText);
-      pointElement->LinkEndChild(pointXElement);
-
-      auto *pointYElement = new TiXmlElement(XML_Y);
-      TiXmlText *pointYText = new TiXmlText(ConvertToString(point[1]));
-      pointYElement->LinkEndChild(pointYText);
-      pointElement->LinkEndChild(pointYElement);
-
-      auto *pointZElement = new TiXmlElement(XML_Z);
-      TiXmlText *pointZText = new TiXmlText(ConvertToString(point[2]));
-      pointZElement->LinkEndChild(pointZText);
-      pointElement->LinkEndChild(pointZElement);
+      auto *pointSpecElement = doc.NewElement(XML_SPEC.c_str());
+      auto *pointSpecText = doc.NewText(ConvertToString(pointSet->GetSpecificationTypeInfo(it->Index(), i)).c_str());
+      pointSpecElement->InsertEndChild(pointSpecText);
+      pointElement->InsertEndChild(pointSpecElement);
+
+      auto *pointXElement = doc.NewElement(XML_X.c_str());
+      auto *pointXText = doc.NewText(ConvertToString(point[0]).c_str());
+      pointXElement->InsertEndChild(pointXText);
+      pointElement->InsertEndChild(pointXElement);
+
+      auto *pointYElement = doc.NewElement(XML_Y.c_str());
+      auto *pointYText = doc.NewText(ConvertToString(point[1]).c_str());
+      pointYElement->InsertEndChild(pointYText);
+      pointElement->InsertEndChild(pointYElement);
+
+      auto *pointZElement = doc.NewElement(XML_Z.c_str());
+      auto *pointZText = doc.NewText(ConvertToString(point[2]).c_str());
+      pointZElement->InsertEndChild(pointZText);
+      pointElement->InsertEndChild(pointZElement);
     }
   }
 
   return pointSetElement;
 }
 
 template <typename T>
 std::string mitk::PointSetWriterService::ConvertToString(T value)
 {
   std::ostringstream o;
   std::locale I("C");
   o.imbue(I);
 
   if (o << std::setprecision(12) << value)
   {
     return o.str();
   }
   else
   {
     return "conversion error";
   }
 }
diff --git a/Modules/Core/src/IO/mitkPointSetWriterService.h b/Modules/Core/src/IO/mitkPointSetWriterService.h
index b9b55d4aef..68aa0e99e7 100644
--- a/Modules/Core/src/IO/mitkPointSetWriterService.h
+++ b/Modules/Core/src/IO/mitkPointSetWriterService.h
@@ -1,71 +1,75 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef _MITK_POINT_SET_WRITER_SERVICE__H_
 #define _MITK_POINT_SET_WRITER_SERVICE__H_
 
 #include <mitkAbstractFileWriter.h>
 #include <mitkPointSet.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   class Geometry3D;
 
   /**
    * @internal
    *
    * @brief XML-based writer for mitk::PointSets
    *
    * XML-based writer for mitk::PointSet. Multiple PointSets can be written in
    * a single XML file by simply setting multiple inputs to the filter.
    *
    * @todo This class would merit a XML library for maintainability or a denser format for performance.
    *
    * @ingroup IO
    */
   class PointSetWriterService : public AbstractFileWriter
   {
   public:
     PointSetWriterService();
     ~PointSetWriterService() override;
 
     using AbstractFileWriter::Write;
     void Write() override;
 
   private:
     PointSetWriterService(const PointSetWriterService &other);
 
     mitk::PointSetWriterService *Clone() const override;
 
     template <typename T>
     std::string ConvertToString(T value);
 
-    TiXmlElement *ToXML(const mitk::PointSet *pointSet);
+    tinyxml2::XMLElement *ToXML(tinyxml2::XMLDocument &doc, const mitk::PointSet *pointSet);
 
     static const std::string XML_POINT_SET;
     static const std::string XML_TIME_SERIES;
     static const std::string XML_TIME_SERIES_ID;
     static const std::string XML_POINT_SET_FILE;
     static const std::string XML_FILE_VERSION;
     static const std::string XML_POINT;
     static const std::string XML_SPEC;
     static const std::string XML_ID;
     static const std::string XML_X;
     static const std::string XML_Y;
     static const std::string XML_Z;
     static const std::string VERSION_STRING;
   };
 }
 
 #endif
diff --git a/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.cpp b/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.cpp
index 6df438ad99..3b42888705 100644
--- a/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.cpp
+++ b/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.cpp
@@ -1,162 +1,164 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkProportionalTimeGeometryToXML.h"
 
 #include "mitkGeometry3DToXML.h"
 
-#include <tinyxml.h>
-
 #include <mitkLexicalCast.h>
 
-TiXmlElement *mitk::ProportionalTimeGeometryToXML::ToXML(const ProportionalTimeGeometry *timeGeom)
+#include <tinyxml2.h>
+
+tinyxml2::XMLElement *mitk::ProportionalTimeGeometryToXML::ToXML(tinyxml2::XMLDocument& doc, const ProportionalTimeGeometry *timeGeom)
 {
   assert(timeGeom);
 
-  auto *timeGeomElem = new TiXmlElement("ProportionalTimeGeometry");
-  timeGeomElem->SetAttribute("NumberOfTimeSteps", timeGeom->CountTimeSteps());
+  auto *timeGeomElem = doc.NewElement("ProportionalTimeGeometry");
+  timeGeomElem->SetAttribute("NumberOfTimeSteps", static_cast<int>(timeGeom->CountTimeSteps()));
   // TinyXML cannot serialize infinity (default value for time step)
   // So we guard this value and the first time point against serialization problems
   // by not writing them. The reader can then tell that absence of those values
   // means "keep the default values"
   if (timeGeom->GetFirstTimePoint() != -std::numeric_limits<TimePointType>::max())
-    timeGeomElem->SetAttribute("FirstTimePoint", boost::lexical_cast<std::string>(timeGeom->GetFirstTimePoint()));
+    timeGeomElem->SetAttribute("FirstTimePoint", boost::lexical_cast<std::string>(timeGeom->GetFirstTimePoint()).c_str());
   if (timeGeom->GetStepDuration() != std::numeric_limits<TimePointType>::infinity())
-    timeGeomElem->SetAttribute("StepDuration", boost::lexical_cast<std::string>(timeGeom->GetStepDuration()));
+    timeGeomElem->SetAttribute("StepDuration", boost::lexical_cast<std::string>(timeGeom->GetStepDuration()).c_str());
 
   for (TimeStepType t = 0; t < timeGeom->CountTimeSteps(); ++t)
   {
     // add a node for the geometry of each time step
     const Geometry3D *geom3D(nullptr);
     if ((geom3D = dynamic_cast<const Geometry3D *>(timeGeom->GetGeometryForTimeStep(t).GetPointer())))
     {
-      TiXmlElement *geom3DElement = Geometry3DToXML::ToXML(geom3D);
-      geom3DElement->SetAttribute("TimeStep", t); // mark order for us
-      timeGeomElem->LinkEndChild(geom3DElement);
+      auto *geom3DElement = Geometry3DToXML::ToXML(doc, geom3D);
+      geom3DElement->SetAttribute("TimeStep", static_cast<int>(t)); // mark order for us
+      timeGeomElem->InsertEndChild(geom3DElement);
     }
     else
     {
       MITK_WARN << "Serializing a ProportionalTimeGeometry that contains something other than Geometry3D!"
                 << " (in time step " << t << ")"
                 << " File will miss information!";
     }
   }
 
   return timeGeomElem;
 }
 
-mitk::ProportionalTimeGeometry::Pointer mitk::ProportionalTimeGeometryToXML::FromXML(TiXmlElement *timeGeometryElement)
+mitk::ProportionalTimeGeometry::Pointer mitk::ProportionalTimeGeometryToXML::FromXML(const tinyxml2::XMLElement *timeGeometryElement)
 {
   if (!timeGeometryElement)
   {
     MITK_ERROR << "Cannot deserialize ProportionalTimeGeometry from nullptr.";
     return nullptr;
   }
 
   int numberOfTimeSteps = 0;
 
-  if (TIXML_SUCCESS != timeGeometryElement->QueryIntAttribute("NumberOfTimeSteps", &numberOfTimeSteps))
+  if (tinyxml2::XML_SUCCESS != timeGeometryElement->QueryIntAttribute("NumberOfTimeSteps", &numberOfTimeSteps))
   {
     MITK_WARN << "<ProportionalTimeGeometry> found without NumberOfTimeSteps attribute. Counting...";
   }
 
   // might be missing!
   TimePointType firstTimePoint;
-  std::string firstTimePoint_s;
+  const char* firstTimePoint_s = nullptr;
   TimePointType stepDuration;
-  std::string stepDuration_s;
+  const char* stepDuration_s = nullptr;
   try
   {
-    if (TIXML_SUCCESS == timeGeometryElement->QueryStringAttribute("FirstTimePoint", &firstTimePoint_s))
+    firstTimePoint_s = timeGeometryElement->Attribute("FirstTimePoint");
+    if (nullptr != firstTimePoint_s)
     {
       firstTimePoint = boost::lexical_cast<double>(firstTimePoint_s);
     }
     else
     {
       firstTimePoint = -std::numeric_limits<TimePointType>::max();
     }
 
-    if (TIXML_SUCCESS == timeGeometryElement->QueryStringAttribute("StepDuration", &stepDuration_s))
+    stepDuration_s = timeGeometryElement->Attribute("StepDuration");
+    if (nullptr != stepDuration_s)
     {
       stepDuration = boost::lexical_cast<double>(stepDuration_s);
     }
     else
     {
       stepDuration = std::numeric_limits<TimePointType>::infinity();
     }
   }
   catch ( const boost::bad_lexical_cast &e )
   {
     MITK_ERROR << "Could not parse string as number: " << e.what();
     return nullptr;
   }
 
   // list of all geometries with their time steps
   std::multimap<TimeStepType, BaseGeometry::Pointer> allReadGeometries;
 
   int indexForUnlabeledTimeStep(-1);
-  for (TiXmlElement *currentElement = timeGeometryElement->FirstChildElement(); currentElement != nullptr;
+  for (auto *currentElement = timeGeometryElement->FirstChildElement(); currentElement != nullptr;
        currentElement = currentElement->NextSiblingElement())
   {
     // different geometries could have been inside a ProportionalTimeGeometry.
     // By now, we only support Geometry3D
     std::string tagName = currentElement->Value();
     if (tagName == "Geometry3D")
     {
       Geometry3D::Pointer restoredGeometry = Geometry3DToXML::FromXML(currentElement);
       if (restoredGeometry.IsNotNull())
       {
         int timeStep(-1);
-        if (TIXML_SUCCESS != currentElement->QueryIntAttribute("TimeStep", &timeStep))
+        if (tinyxml2::XML_SUCCESS != currentElement->QueryIntAttribute("TimeStep", &timeStep))
         {
           timeStep = indexForUnlabeledTimeStep--; // decrement index for next one
           MITK_WARN << "Found <Geometry3D> without 'TimeStep' attribute in <ProportionalTimeGeometry>. No guarantees "
                        "on order anymore.";
         }
 
         if (allReadGeometries.count(static_cast<TimeStepType>(timeStep)) > 0)
         {
           MITK_WARN << "Found <Geometry3D> tags with identical 'TimeStep' attribute in <ProportionalTimeGeometry>. No "
                        "guarantees on order anymore.";
         }
 
         allReadGeometries.insert(std::make_pair(static_cast<TimeStepType>(timeStep), restoredGeometry.GetPointer()));
       }
     }
     else
     {
       MITK_WARN << "Found unsupported tag <" << tagName << "> inside <ProportionalTimeGeometry>. Ignoring.";
     }
   }
 
   // now add all BaseGeometries that were read to a new instance
   // of ProportionalTimeGeometry
   ProportionalTimeGeometry::Pointer newTimeGeometry = ProportionalTimeGeometry::New();
   newTimeGeometry->SetFirstTimePoint(firstTimePoint);
   newTimeGeometry->SetStepDuration(stepDuration);
   newTimeGeometry->ReserveSpaceForGeometries(allReadGeometries.size());
 
   TimeStepType t(0);
   for (auto entry : allReadGeometries)
   {
     // We add items with newly assigned time steps.
     // This avoids great confusion when a file contains
     // bogus numbers.
     newTimeGeometry->SetTimeStepGeometry(entry.second, t++);
   }
 
   // Need to re-calculate global bounding box.
   // This is neither stored in a file, nor done by SetTimeStepGeometry
   newTimeGeometry->UpdateBoundingBox();
 
   return newTimeGeometry;
 }
diff --git a/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.h b/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.h
index 5091a9a482..5ccd053619 100644
--- a/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.h
+++ b/Modules/Core/src/IO/mitkProportionalTimeGeometryToXML.h
@@ -1,51 +1,54 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkProportionalTimeGeometryToXML_h
 #define mitkProportionalTimeGeometryToXML_h
 
-// MITK
 #include "mitkProportionalTimeGeometry.h"
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
    * @internal
    *
    * @brief Helper for ProportionalTimeGeometry related I/O classes.
    *
    * Creates TinyXML elements (blocks) that describe a ProportionalTimeGeometry.
    * Also offers a method to read such blocks and create a corresponding ProportionalTimeGeometry.
    *
    * @sa GeometryDataWriterService, GeometryDataReaderService, Geometry3DToXML
    *
    * @ingroup IO
    */
   class ProportionalTimeGeometryToXML
   {
   public:
     /**
      * @brief Serialize given geometry to XML.
      */
-    static TiXmlElement *ToXML(const ProportionalTimeGeometry *geometry);
+    static tinyxml2::XMLElement *ToXML(tinyxml2::XMLDocument& doc, const ProportionalTimeGeometry *geometry);
 
     /**
      * @brief Create a ProportionalTimeGeometry from XML.
      * Interprets only the format created by ToXML().
      */
-    static ProportionalTimeGeometry::Pointer FromXML(TiXmlElement *node);
+    static ProportionalTimeGeometry::Pointer FromXML(const tinyxml2::XMLElement *node);
   };
 }
 
 #endif
diff --git a/Modules/Core/test/CMakeLists.txt b/Modules/Core/test/CMakeLists.txt
index d3d3321aed..c1758a4f44 100644
--- a/Modules/Core/test/CMakeLists.txt
+++ b/Modules/Core/test/CMakeLists.txt
@@ -1,181 +1,181 @@
 # The core tests need relaxed compiler flags...
 # TODO fix core tests to compile without these additional no-error flags
 if(MSVC_VERSION)
   # disable deprecated warnings (they would lead to errors)
   mitkFunctionCheckCAndCXXCompilerFlags("/wd4996" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 else()
   mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated-declarations" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()
 
 MITK_CREATE_MODULE_TESTS()
 if(TARGET ${TESTDRIVER})
-  mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES ITK|ITKThresholding+ITKTestKernel VTK|TestingRendering tinyxml)
+  mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES ITK|ITKThresholding+ITKTestKernel VTK|TestingRendering tinyxml2|tinyxml2)
 
   mitkAddCustomModuleTest(mitkVolumeCalculatorTest_Png2D-bw mitkVolumeCalculatorTest
                           ${MITK_DATA_DIR}/Png2D-bw.png
                           ${MITK_DATA_DIR}/Pic2DplusT.nrrd
   )
 
 
   mitkAddCustomModuleTest(mitkEventConfigTest_CreateObjectInDifferentWays mitkEventConfigTest
                           ${MITK_SOURCE_DIR}/Modules/Core/test/resource/Interactions/StatemachineConfigTest.xml
   )
 
 
   mitkAddCustomModuleTest(mitkDataStorageTest_US4DCyl mitkDataStorageTest
                           ${MITK_DATA_DIR}/US4DCyl.nrrd
   )
 
 
   mitkAddCustomModuleTest(mitkPointSetReaderTest mitkPointSetReaderTest
                           ${MITK_DATA_DIR}/PointSetReaderTestData.mps
   )
 
   mitkAddCustomModuleTest(mitkImageTest_4DImageData mitkImageTest
                           ${MITK_DATA_DIR}/US4DCyl.nrrd
   )
 
   mitkAddCustomModuleTest(mitkImageTest_2D+tImageData mitkImageTest
                           ${MITK_DATA_DIR}/Pic2DplusT.nrrd
   )
 
   mitkAddCustomModuleTest(mitkImageTest_3DImageData mitkImageTest
                           ${MITK_DATA_DIR}/Pic3D.nrrd
   )
 
   mitkAddCustomModuleTest(mitkImageEqualTest mitkImageEqualTest)
 
   mitkAddCustomModuleTest(mitkImageTest_brainImage mitkImageTest
                           ${MITK_DATA_DIR}/brain.mhd
   )
 
   mitkAddCustomModuleTest(mitkLevelWindowManagerTest mitkLevelWindowManagerTest
                           ${MITK_DATA_DIR}/Pic3D.nrrd
   )
 
   mitkAddCustomModuleTest(mitkMultiComponentImageDataComparisonFilterTest mitkMultiComponentImageDataComparisonFilterTest
                           ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg
   )
 
   mitkAddCustomModuleTest(mitkImageToItkTest mitkImageToItkTest
                           ${MITK_DATA_DIR}/Pic3D.nrrd
   )
 
   mitkAddCustomModuleTest(mitkImageSliceSelectorTest mitkImageSliceSelectorTest
                           ${MITK_DATA_DIR}/Pic2DplusT.nrrd
   )
 
   mitkAddCustomModuleTest(mitkRotatedSlice4DTest mitkRotatedSlice4DTest
                           ${MITK_DATA_DIR}/UltrasoundImages/4D_TEE_Data_MV.dcm
   )
 
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2DTest
                           ${MITK_DATA_DIR}/RenderingTestData/rgbaImage.png #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/rgbaImage640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
                           ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3d640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2DColorTest #test for color property (=blue) Pic3D sagittal slice
                           ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dColorBlue640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2DLevelWindowTest #test for levelwindow property (=blood) #Pic3D sagittal slice
                           ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dLevelWindowBlood640x480REF.png #corresponding reference #screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DSwivelTest #test for a randomly chosen Pic3D swivelled slice
                           ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dSwivel640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2DTest
                           ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAlone640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2DImageTest
                           ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/PointSetForPic3D.mps #input point set and image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Pic3DPointSetForPic3D640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2DGlyphTypeTest
                            ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneGlyphType640x480REF.png #corresponding reference screenshot
   )
   mitkAddCustomModuleRenderingTest(mitkPointSetVtkMapper2D_openMeAloneTransformed640x480 mitkPointSetVtkMapper2DTransformedPointsTest
                            ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneTransformedPoints640x480REF.png #corresponding reference screenshot
   )
   # Currently not working on windows because of a rendering timing issue
   # see bug 18083 for details
   if(NOT WIN32)
     mitkAddCustomModuleRenderingTest(mitkSurfaceDepthSortingTransparency_StanfordBunnySTL640x480 mitkSurfaceDepthSortingTest
                             ${MITK_DATA_DIR}/RenderingTestData/Stanford_bunny.stl
                             -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Stanford_bunnySTLDepthSorting640x480REF.png)
   endif()
 
   # BUG 18695 - tests deactivated, because win 32 bit continuous renders images slightly different. TODO!
   #Test reslice interpolation
   #note: nearest mode is already tested by swivel test
   #mitkAddCustomModuleRenderingTest(ResliceInterpolationIsLinear mitkImageVtkMapper2DResliceInterpolationPropertyTest
   #                        1 #linear
   #                        ${MITK_DATA_DIR}/Pic3D.nrrd
   #                        -V
   #                        ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefLinear.png #corresponding reference screenshot LINEAR
   #)
 
   #mitkAddCustomModuleRenderingTest(ResliceInterpolationIsCubic mitkImageVtkMapper2DResliceInterpolationPropertyTest
   #                        3 #cubic
   #                        ${MITK_DATA_DIR}/Pic3D.nrrd
   #                        -V
   #                        ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefCubic.png #corresponding reference screenshot CUBIC
   #)
   #End test reslice interpolation
 
   # Testing of the rendering of binary images
   #mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_binaryTestImage640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
   #                        ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
   #                        -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImage640x480REF.png #corresponding reference screenshot
   #)
   #mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2D_binaryTestImageWithRef640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice
   #                        ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage
   #                        -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImageWithRef640x480REF.png #corresponding reference screenshot
   #)
   # End of binary image tests
 
   mitkAddCustomModuleRenderingTest(mitkSurfaceVtkMapper3DTest_TextureProperty mitkSurfaceVtkMapper3DTest
                           ${MITK_DATA_DIR}/RenderingTestData/earth.jpg
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/texturedSphere640x480REF.png #corresponding reference screenshot
   )
 
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DTransferFunctionTest
                           ${MITK_DATA_DIR}/Png2D-bw.png
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-TransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
   )
 
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2DOpacityTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DOpacityTransferFunctionTest
                           ${MITK_DATA_DIR}/Png2D-bw.png
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-OpacityTransferFunctionRGBImage640x480REF.png #corresponding reference screenshot
   )
 
   ############################## DISABLED TESTS
 
   mitkAddCustomModuleRenderingTest(mitkImageVtkMapper2DLookupTableTest_Png2D-bw mitkImageVtkMapper2DLookupTableTest
                           ${MITK_DATA_DIR}/Png2D-bw.png
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-LookupTableRGBImage640x480REF.png #corresponding reference screenshot
   )
 
   #mitkAddCustomModuleRenderingTest(mitkImageTest_color2DImage mitkImageTest
   #                        ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg
   #)
 
   #mitkAddCustomModuleRenderingTest(mitkNodeDependentPointSetInteractorTest mitkNodeDependentPointSetInteractorTest
   #                        ${MITK_DATA_DIR}/Pic3D.pic.gz ${MITK_DATA_DIR}/BallBinary30x30x30.pic.gz
   #)
 
   mitkAddCustomModuleRenderingTest(mitkPlaneGeometryDataMapper2DTest mitkPlaneGeometryDataMapper2DTest
                           ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage
                           -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/PlaneGeometryMapper640x480REF.png #corresponding reference screenshot
   )
 
 endif() # TARGET ${TESTDRIVER}
diff --git a/Modules/Core/test/mitkTinyXMLTest.cpp b/Modules/Core/test/mitkTinyXMLTest.cpp
index ddd251e473..392ab4384d 100644
--- a/Modules/Core/test/mitkTinyXMLTest.cpp
+++ b/Modules/Core/test/mitkTinyXMLTest.cpp
@@ -1,159 +1,162 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 // Testing
 #include "mitkTestFixture.h"
 #include <mitkTestingMacros.h>
 
 // std includes
 #include <cmath>
 #include <iomanip>
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 // MITK includes
 #include "mitkStringProperty.h"
 #include <mitkNumericTypes.h>
 
 // itksys
 #include <itksys/SystemTools.hxx>
 
 // VTK includes
 #include <vtkDebugLeaks.h>
 
 // vnl includes
 #include <vnl/vnl_vector_fixed.hxx>
 
 class mitkTinyXMLTestSuite : public mitk::TestFixture
 {
   CPPUNIT_TEST_SUITE(mitkTinyXMLTestSuite);
 
   MITK_TEST(TestingFunctionSetupWorks_Success);
   MITK_TEST(TestingReadValueFromSetupDocument_Success);
   MITK_TEST(TestingReadOutValueWorks_Success);
   MITK_TEST(TestDoubleValueWriteOut_Success);
   MITK_TEST(TestDoubleValueWriteOutManyDecimalPlaces_Success);
 
   CPPUNIT_TEST_SUITE_END();
 
 private:
   const std::string m_Filename = itksys::SystemTools::GetCurrentWorkingDirectory() + "/TinyXMLTest.txt";
   const std::string m_ElementToStoreAttributeName = "DoubleTest";
   const std::string m_AttributeToStoreName = "CommaValue";
 
-  TiXmlDocument m_Document;
-  TiXmlElement *m_DoubleTest;
+  tinyxml2::XMLDocument m_Document;
+  tinyxml2::XMLElement *m_DoubleTest;
 
   double calcPrecision(const unsigned int requiredDecimalPlaces)
   {
     return pow(10.0, -1.0 * ((double)requiredDecimalPlaces));
   }
 
   bool Setup(double valueToWrite)
   {
+    m_Document.Clear();
+    m_DoubleTest = nullptr;
+
     // 1. create simple document
-    auto decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc....
-    m_Document.LinkEndChild(decl);
+    m_Document.InsertEndChild(m_Document.NewDeclaration());
 
-    auto version = new TiXmlElement("Version");
+    auto *version = m_Document.NewElement("Version");
     version->SetAttribute("Writer", __FILE__);
     version->SetAttribute("CVSRevision", "$Revision: 17055 $");
     version->SetAttribute("FileVersion", 1);
-    m_Document.LinkEndChild(version);
+    m_Document.InsertEndChild(version);
 
     // 2. store one element containing a double value with potentially many after comma digits.
-    auto vElement = new TiXmlElement(m_ElementToStoreAttributeName);
-    vElement->SetDoubleAttribute(m_AttributeToStoreName, valueToWrite);
-    m_Document.LinkEndChild(vElement);
+    auto *vElement = m_Document.NewElement(m_ElementToStoreAttributeName.c_str());
+    vElement->SetAttribute(m_AttributeToStoreName.c_str(), valueToWrite);
+    m_Document.InsertEndChild(vElement);
 
     // 3. store in file.
-    return m_Document.SaveFile(m_Filename);
+    auto err = m_Document.SaveFile(m_Filename.c_str());
+    return tinyxml2::XML_SUCCESS == err;
   }
 
 public:
   void setUp() override {}
 
   void tearDown() override {}
 
   void TestingFunctionSetupWorks_Success()
   {
     CPPUNIT_ASSERT_MESSAGE("Test if Setup correctly writes data to file", Setup(1.0));
   }
 
   int readValueFromSetupDocument(double &readOutValue)
   {
-    if (!m_Document.LoadFile(m_Filename))
+    if (tinyxml2::XML_SUCCESS != m_Document.LoadFile(m_Filename.c_str()))
     {
       CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", false);
-      return TIXML_NO_ATTRIBUTE;
+      return tinyxml2::XML_NO_ATTRIBUTE;
     }
     else
     {
-      m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName);
-      return m_DoubleTest->QueryDoubleAttribute(m_AttributeToStoreName, &readOutValue);
+      m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName.c_str());
+      return m_DoubleTest->QueryDoubleAttribute(m_AttributeToStoreName.c_str(), &readOutValue);
     }
   }
 
   void TestingReadValueFromSetupDocument_Success()
   {
-    if (!m_Document.LoadFile(m_Filename))
+    if (tinyxml2::XML_SUCCESS != m_Document.LoadFile(m_Filename.c_str()))
     {
-      CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", !m_Document.LoadFile(m_Filename));
+      CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", tinyxml2::XML_SUCCESS != m_Document.LoadFile(m_Filename.c_str()));
     }
     else
     {
-      m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName);
+      m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName.c_str());
       CPPUNIT_ASSERT_MESSAGE("Test Setup could open file", m_DoubleTest != nullptr);
     }
   }
 
   /**
    * this first test ensures we can correctly readout values from the
    * TinyXMLDocument.
    */
   void TestingReadOutValueWorks_Success()
   {
     double readValue;
 
     CPPUNIT_ASSERT_MESSAGE("checking if readout mechanism works.",
-                           TIXML_SUCCESS == readValueFromSetupDocument(readValue));
+                           tinyxml2::XML_SUCCESS == readValueFromSetupDocument(readValue));
   }
 
   void TestDoubleValueWriteOut_Success()
   {
     const double valueToWrite = -1.123456;
     const int validDigitsAfterComma = 6; // indicates the number of valid digits after comma of valueToWrite
     const double neededPrecision = calcPrecision(validDigitsAfterComma + 1);
     double readValue;
 
     Setup(valueToWrite);
     readValueFromSetupDocument(readValue);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite  equals  readValue which was retrieved from TinyXML document",
                            mitk::Equal(valueToWrite, readValue, neededPrecision));
   }
 
   void TestDoubleValueWriteOutManyDecimalPlaces_Success()
   {
     const double valueToWrite = -1.12345678910111;
     const int validDigitsAfterComma = 14; // indicates the number of valid digits after comma of valueToWrite
     const double neededPrecision = calcPrecision(validDigitsAfterComma + 1);
     double readValue;
 
     Setup(valueToWrite);
 
     readValueFromSetupDocument(readValue);
 
     CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite equals readValue which was retrieved from TinyXML document",
                            mitk::Equal(valueToWrite, readValue, neededPrecision));
   }
 };
 
 MITK_TEST_SUITE_REGISTRATION(mitkTinyXML)
diff --git a/Modules/DICOM/CMakeLists.txt b/Modules/DICOM/CMakeLists.txt
index 98d7de357c..2bedc88018 100644
--- a/Modules/DICOM/CMakeLists.txt
+++ b/Modules/DICOM/CMakeLists.txt
@@ -1,9 +1,15 @@
 MITK_CREATE_MODULE(
   DEPENDS MitkCore
   PACKAGE_DEPENDS
-    PUBLIC tinyxml GDCM
+    PUBLIC tinyxml2|tinyxml2 GDCM
     PRIVATE ITK|ITKIOImageBase+ITKIOGDCM DCMTK
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PUBLIC tinyxml2::tinyxml2
+  )
+endif()
+
 add_subdirectory(test)
 add_subdirectory(autoload/DICOMImageIO)
diff --git a/Modules/DICOM/include/mitkDICOMReaderConfigurator.h b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
index e098ee4b85..00da6131c2 100644
--- a/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
+++ b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
@@ -1,142 +1,145 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkDICOMReaderConfigurator_h
 #define mitkDICOMReaderConfigurator_h
 
 #include "mitkClassicDICOMSeriesReader.h"
 #include "mitkDICOMTagBasedSorter.h"
 
-// to put into private implementation
-#include "tinyxml.h"
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
 
 /**
   \ingroup DICOMModule
   \brief Too-simple factory to create DICOMFileReader%s.
 
   This class is able to instantiate and configure (where possible) DICOMFileReader%s from XML descriptions.
   \note This is a bad factory example, because the factory is not extensible and needs to know all the specific readers. A flexible implementation should be provided in a future version.
 
   In its current version, the XML input is meant to be structured like
 \verbatim
 <?xml version="1.0" standalone=no>
 <DICOMFileReader
   label="Example Reader"
   description="Sort images by example tags"
   class="DICOMITKSeriesGDCMReader"
   fixTiltByShearing="true">
 <Distinguishing>
  <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
  <Tag name="SeriesNumber" group="0020" element="0011"/>
 </Distinguishing>
 <Sorting>
  <ImagePositionPatient/>
  <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
 </Sorting>
 </DICOMFileReader>
 \endverbatim
 
   The root-tag \c \<DICOMFileReader\> names the class to be instantiated, currently this can be one of
    - DICOMITKSeriesGDCMReader
    - ThreeDnTDICOMSeriesReader
 
   Both classes bring simple configuration flags with them and a description of how images are sorted prior to loading.
 
   Flag for DICOMITKSeriesGDCMReader:
   <pre>fixTiltByShearing="true|false"</pre>
   Determines whether a potential gantry tilt should be "fixed" by shearing the output image.
 
   Flag for ThreeDnTDICOMSeriesReader:
   <pre>group3DnT="true|false"</pre>
   Determines whether images at the same spatial position should be interpreted as 3D+t images.
 
   The tags \c \<Distinguishing\> and \c \<Sorting\> describe the basic loading strategy of both
   reader mentioned above: first images are divided into incompatible groups (\c \<Distinguishing\>),
   and afterwards the images within each group are sorted by means of DICOMSortCriterion, which
   most commonly mentions a tag.
 
   Tag element and group are interpreted as the exadecimal numbers
   found all around the DICOM standard. The numbers can be prepended by a "0x" if this is preferred
   by the programmer (but they are taken as hexadecimal in all cases).
 
   \section DICOMReaderConfigurator_AboutTheFuture About the future evolution of this class
 
   This first version is hard coded for the current state of the implementation.
 
   If things should evolve in a way that needs us to splitt off readers for "old" versions,
   time should be taken to refactor this class.
 
   Basically, a serializer class should accompany each of the configurable classes. Such
   serializer classes should be registered and discovered via micro-services (to support extensions).
   A serializer should offer both methods to serialize a class and to desirialize it again.
 
   A "version" attribute at the top-level tag should be used to distinguish versions.
 
   Usually it should be enough to keep DE-serializers for all versions. Writers for the most
   recent version should be enough.
 */
 class MITKDICOM_EXPORT DICOMReaderConfigurator : public itk::LightObject
 {
   public:
 
     mitkClassMacroItkParent( DICOMReaderConfigurator, itk::LightObject );
     itkNewMacro( DICOMReaderConfigurator );
 
     DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
     DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
 
     std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
 
   protected:
 
     DICOMReaderConfigurator();
     ~DICOMReaderConfigurator() override;
 
   private:
 
-    DICOMFileReader::Pointer CreateFromTiXmlDocument(TiXmlDocument& doc) const;
-    DICOMTag tagFromXMLElement(TiXmlElement*) const;
-    std::string requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const;
+    DICOMFileReader::Pointer CreateFromXMLDocument(tinyxml2::XMLDocument& doc) const;
+    DICOMTag tagFromXMLElement(const tinyxml2::XMLElement*) const;
+    std::string requiredStringAttribute(const tinyxml2::XMLElement* xmlElement, const std::string& key) const;
     unsigned int hexStringToUInt(const std::string& s) const;
 
-    ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement*) const;
-    DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement*) const;
-    void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const;
-    void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const;
+    ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement*) const;
+    DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement*) const;
+    void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement* element) const;
+    void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement* element) const;
+
+    DICOMSortCriterion::Pointer CreateDICOMSortByTag(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
+    DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
 
-    DICOMSortCriterion::Pointer CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
-    DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
+    mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(const tinyxml2::XMLElement* element) const;
 
-    mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(TiXmlElement* element) const;
+    tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const DICOMITKSeriesGDCMReader* reader) const;
+    tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ThreeDnTDICOMSeriesReader* reader) const;
+    tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ClassicDICOMSeriesReader* reader) const;
 
-    TiXmlElement* CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const;
-    TiXmlElement* CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const;
-    TiXmlElement* CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const;
+    tinyxml2::XMLElement* CreateConfigStringFromDICOMDatasetSorter(tinyxml2::XMLDocument& doc, const DICOMTagBasedSorter* sorter) const;
 
-    TiXmlElement* CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const;
+    tinyxml2::XMLElement* CreateConfigStringFromDICOMTag(tinyxml2::XMLDocument& doc, const DICOMTag& tag) const;
 
-    TiXmlElement* CreateConfigStringFromDICOMTag(const DICOMTag& tag) const;
+    tinyxml2::XMLElement* CreateDICOMFileReaderTag(tinyxml2::XMLDocument& doc, const DICOMFileReader* reader) const;
 
-    TiXmlElement* CreateDICOMFileReaderTag(const DICOMFileReader* reader) const;
-    const char* toString(bool) const;
     std::string toHexString(unsigned int i) const;
 
     /** Helper that queries an boolean xml attribute. If the attribute does not exist, the passed default value is used.*/
-    bool QueryBooleanAttribute(const TiXmlElement* element, const char* attributeName, bool defaultValue) const;
+    bool QueryBooleanAttribute(const tinyxml2::XMLElement* element, const char* attributeName, bool defaultValue) const;
  };
 
 } // namespace
 
 #endif // mitkDICOMReaderConfigurator_h
diff --git a/Modules/DICOM/resource/configurations/3D/classicreader.xml b/Modules/DICOM/resource/configurations/3D/classicreader.xml
index 7ed3332f6a..e5e063d39c 100644
--- a/Modules/DICOM/resource/configurations/3D/classicreader.xml
+++ b/Modules/DICOM/resource/configurations/3D/classicreader.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="2013 default sorting"
   description="Sort images by Image Position, then by Acquisition Number, Acq. Time, Trigger time, group tilted images"
   class="ClassicDICOMSeriesReader"
   version="2"
   group3DnT="false"
   fixTiltByShearing="true"
   >
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/imageposition.xml b/Modules/DICOM/resource/configurations/3D/imageposition.xml
index c00d4cd8e2..09b55d3ecf 100644
--- a/Modules/DICOM/resource/configurations/3D/imageposition.xml
+++ b/Modules/DICOM/resource/configurations/3D/imageposition.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Image Position"
   description="Sort images by Image Position (Patient)"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="false" expectDistanceOne="false">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <ImagePositionPatient/>
    <Tag name="AcquisitionTime" group="0x0008" element="0x0032"/>
    <Tag name="TriggerTime" group="0x0018" element="0x1060"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml b/Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml
index 54b9f6377a..d145528099 100644
--- a/Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml
+++ b/Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml
@@ -1,26 +1,26 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Image Position by Acquisition"
   description="Group images by Acquistion, then sort groups by Image Position (Patient)"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="false" expectDistanceOne="false">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <ImagePositionPatient/>
    <Tag name="AcquisitionTime" group="0x0008" element="0x0032"/>
    <Tag name="TriggerTime" group="0x0018" element="0x1060"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/imagetime.xml b/Modules/DICOM/resource/configurations/3D/imagetime.xml
index 83cdb1c1b0..62e97e455f 100644
--- a/Modules/DICOM/resource/configurations/3D/imagetime.xml
+++ b/Modules/DICOM/resource/configurations/3D/imagetime.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Image Time"
   description="Sort images by Acqusition Time"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="true">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <Tag name="AcquisitionTime" group="0x0008" element="0x0032"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/instancenumber.xml b/Modules/DICOM/resource/configurations/3D/instancenumber.xml
index f83b56e3c8..1fd86e4db6 100644
--- a/Modules/DICOM/resource/configurations/3D/instancenumber.xml
+++ b/Modules/DICOM/resource/configurations/3D/instancenumber.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Instance Number, consecutive"
   description="Sort images by Instance Number, require equal distances of 1"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="true">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <Tag name="InstanceNumber" group="0x0020" element="0x0013"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml b/Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml
index 1c2c660700..9cf61cbfcf 100644
--- a/Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml
+++ b/Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Instance Number, non-consecutive"
   description="Sort images by Instance Number, do not require consecutive numbers"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="false" expectDistanceOne="false">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <Tag name="InstanceNumber" group="0x0020" element="0x0013"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml b/Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml
index 79c636e78b..eba6bbef60 100644
--- a/Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml
+++ b/Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Instance Number, non-consecutive, simple import"
   description="Sort images by Instance Number, do not require consecutive numbers"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true"
   simpleVolumeImport="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="false" expectDistanceOne="false">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <Tag name="InstanceNumber" group="0x0020" element="0x0013"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3D/slicelocation.xml b/Modules/DICOM/resource/configurations/3D/slicelocation.xml
index 967bb5af57..7ddb18d2f1 100644
--- a/Modules/DICOM/resource/configurations/3D/slicelocation.xml
+++ b/Modules/DICOM/resource/configurations/3D/slicelocation.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="Slice Location"
   description="Sort images by Slice Location, require equal distance between locations"
   class="DICOMITKSeriesGDCMReader"
   version="2"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="false">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020" element="000e"/>
    <Tag name="SeriesDescription" group="0008" element="103e"/>
    <Tag name="ProtocolName" group="0018" element="1030"/>
    <Tag name="SeriesNumber" group="0020" element="0011"/>
    <Tag name="AcquisitionNumber" group="0x0020" element="0x0012"/>
    <Tag name="Modality" group="0x0008" element="0x0060"/>
    <Tag name="BodyPartExamined" group="0x0018" element="0x0015"/>
    <Tag name="SequenceName" group="0x0018" element="0x0024"/>
   </Distinguishing>
   <Sorting>
    <Tag name="SliceLocation" group="0x0020" element="0x1041"/>
    <Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3DnT/classicreader.xml b/Modules/DICOM/resource/configurations/3DnT/classicreader.xml
index 1a0ca7f09a..6d40321c7f 100644
--- a/Modules/DICOM/resource/configurations/3DnT/classicreader.xml
+++ b/Modules/DICOM/resource/configurations/3DnT/classicreader.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   label="2013 default sorting for 3D+t"
   description="ClassicDICOMSeriesReader that is equal to the 2013 implementation for 3D+t images, except it only condenses blocks with same series."
   class="ClassicDICOMSeriesReader"
   version="2"
   group3DnT="true"
   fixTiltByShearing="true"
   onlyCondenseSameSeries="true"
   >
-</DICOMFileReader>
\ No newline at end of file
+</DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3DnT/imageposition.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition.xml
index f8e1601952..a44d46cfc9 100644
--- a/Modules/DICOM/resource/configurations/3DnT/imageposition.xml
+++ b/Modules/DICOM/resource/configurations/3DnT/imageposition.xml
@@ -1,21 +1,21 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   class="ThreeDnTDICOMSeriesReader"
   version="2"
   label="IPP 3D+t"
   description="Sort by Image Position (Patient), then group as 3D+t (till 2018/03 this configuration was wrongly stored in the file classicreader.xml (verison 1))"
   group3DnT="true"
   fixTiltByShearing="true">
 <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="true">
   <Distinguishing>
    <Tag name="SeriesInstanceUID" group="0020," element="000e"/>
   </Distinguishing>
   <Sorting>
    <ImagePositionPatient/>
    <Tag name="AcquisitionNumber" group="0x0020," element="0x0012"/>
    <Tag name="AcquisitionTime" group="0x0008," element="0x0032"/>
    <Tag name="TriggerTime" group="0x0018," element="0x1060"/>
    <Tag name="SOPInstanceUID" group="0x0008," element="0x0018"/>
   </Sorting>
 </DICOMDatasetSorter>
 </DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml
index 1a356abfb1..d6815044b6 100644
--- a/Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml
+++ b/Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml
@@ -1,19 +1,19 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   class="ThreeDnTDICOMSeriesReader"
   version="2"
   label="3D+t by AcquisitionNumber"  description="Group as 3D+t by AcquisitionTime, then sort by Image Position (Patient)"
   group3DnT="true"
   fixTiltByShearing="true">
   <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="true">
     <Distinguishing>
       <Tag name="SeriesInstanceUID" group="0020," element="000e"/>
       <Tag name="AcquisitionTime" group="0x0008," element="0x0032"/>
     </Distinguishing>
     <Sorting>
      <ImagePositionPatient/>
      <Tag name="InstanceNumber" group="0x0020" element="0x0013"/>
      <Tag name="SOPInstanceUID" group="0x0008," element="0x0018"/>
     </Sorting>
   </DICOMDatasetSorter>
-</DICOMFileReader>
\ No newline at end of file
+</DICOMFileReader>
diff --git a/Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml
index f8f636255c..1a3f39fae4 100644
--- a/Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml
+++ b/Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml
@@ -1,19 +1,19 @@
-<?xml version="1.0" standalone=no>
+<?xml version="1.0" standalone="no"?>
 <DICOMFileReader
   class="ThreeDnTDICOMSeriesReader"
   version="2"
   label="3D+t by TriggerTime"  description="Group as 3D+t by TriggerTime, then sort by Image Position (Patient)"
   group3DnT="true"
   fixTiltByShearing="true">
   <DICOMDatasetSorter class="DICOMTagBasedSorter" strictSorting="true" expectDistanceOne="true">
     <Distinguishing>
       <Tag name="SeriesInstanceUID" group="0020," element="000e"/>
       <Tag name="TriggerTime" group="0x0018," element="0x1060"/>
     </Distinguishing>
     <Sorting>
      <ImagePositionPatient/>
      <Tag name="InstanceNumber" group="0x0020" element="0x0013"/>
      <Tag name="SOPInstanceUID" group="0x0008," element="0x0018"/>
     </Sorting>
   </DICOMDatasetSorter>
-</DICOMFileReader>
\ No newline at end of file
+</DICOMFileReader>
diff --git a/Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp b/Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp
index 87e64e6c1c..68f7a4dccb 100644
--- a/Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp
+++ b/Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp
@@ -1,678 +1,673 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkDICOMReaderConfigurator.h"
 
 #include "mitkDICOMSortByTag.h"
 #include "mitkSortByImagePositionPatient.h"
 
+#include <tinyxml2.h>
 
 mitk::DICOMReaderConfigurator
 ::DICOMReaderConfigurator()
 {
 }
 
 mitk::DICOMReaderConfigurator
 ::~DICOMReaderConfigurator()
 {
 }
 
 mitk::DICOMFileReader::Pointer
 mitk::DICOMReaderConfigurator
 ::CreateFromConfigFile(const std::string& filename) const
 {
-  TiXmlDocument doc (filename);
-  if (doc.LoadFile())
+  tinyxml2::XMLDocument doc;
+  if (tinyxml2::XML_SUCCESS == doc.LoadFile(filename.c_str()))
   {
-    return this->CreateFromTiXmlDocument( doc );
+    return this->CreateFromXMLDocument( doc );
   }
   else
   {
     MITK_ERROR << "Unable to load file at '" << filename <<"'";
     return DICOMFileReader::Pointer();
   }
 }
 
 mitk::DICOMFileReader::Pointer
 mitk::DICOMReaderConfigurator
 ::CreateFromUTF8ConfigString(const std::string& xmlContents) const
 {
-  TiXmlDocument doc;
-  doc.Parse(xmlContents.c_str(), nullptr, TIXML_ENCODING_UTF8);
+  tinyxml2::XMLDocument doc;
+  doc.Parse(xmlContents.c_str());
 
-  return this->CreateFromTiXmlDocument( doc );
+  return this->CreateFromXMLDocument( doc );
 }
 
 mitk::DICOMFileReader::Pointer
 mitk::DICOMReaderConfigurator
-::CreateFromTiXmlDocument(TiXmlDocument& doc) const
+::CreateFromXMLDocument(tinyxml2::XMLDocument& doc) const
 {
-  TiXmlHandle root(doc.RootElement());
+  tinyxml2::XMLHandle root(doc.RootElement());
 
-  if (TiXmlElement* rootElement = root.ToElement())
+  if (auto* rootElement = root.ToElement())
   {
     if (strcmp(rootElement->Value(), "DICOMFileReader")) // :-( no std::string methods
     {
       MITK_ERROR << "File should contain a <DICOMFileReader> tag at top-level! Found '"
                  << (rootElement->Value() ? std::string(rootElement->Value()) : std::string("!nothing!")) << "' instead";
       return nullptr;
     }
 
     const char* classnameC = rootElement->Attribute("class");
     if (!classnameC)
     {
       MITK_ERROR << "File should name a reader class in the class attribute: <DICOMFileReader class=\"...\">. Found nothing instead";
       return nullptr;
     }
 
     int version(1);
-    if ( rootElement->QueryIntAttribute("version", &version) == TIXML_SUCCESS)
+    if ( rootElement->QueryIntAttribute("version", &version) == tinyxml2::XML_SUCCESS)
     {
       if (version == 1)
       {
         MITK_WARN << "Warning the given configuration is for DICOMFileReaders of version 1. "
                   << "This old version may be interpreted differently. Reason: "
                   << "The default values for the following xml settings have been changed: "
                   << "FixTiltByShearing (false -> true); StrictSorting (true -> false); ExpectDistanceOne (true -> false).";
       }
       else if (version >2)
       {
         MITK_WARN << "This reader is only capable of creating DICOMFileReaders of version 1 and 2. "
           << "Will not continue, because given configuration is meant for version " << version << ".";
         return nullptr;
       }
     }
     else
     {
       MITK_ERROR << "File should name the version of the reader class in the version attribute: <DICOMFileReader class=\"" << classnameC << "\" version=\"...\">."
                  << " Found nothing instead, assuming version 1!";
       version = 1;
     }
 
     std::string classname(classnameC);
 
     double decimalPlacesForOrientation(mitk::DICOMITKSeriesGDCMReader::GetDefaultDecimalPlacesForOrientation());
     bool useDecimalPlacesForOrientation(false);
     useDecimalPlacesForOrientation =
-      rootElement->QueryDoubleAttribute("decimalPlacesForOrientation", &decimalPlacesForOrientation) == TIXML_SUCCESS; // attribute present and a double value
+      rootElement->QueryDoubleAttribute("decimalPlacesForOrientation", &decimalPlacesForOrientation) == tinyxml2::XML_SUCCESS; // attribute present and a double value
 
     if (classname == "ClassicDICOMSeriesReader")
     {
       mitk::ClassicDICOMSeriesReader::Pointer reader = mitk::ClassicDICOMSeriesReader::New();
       this->ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(reader.GetPointer(), rootElement);
       this->ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(reader.GetPointer(), rootElement);
       return reader.GetPointer();
     }
     if (classname == "ThreeDnTDICOMSeriesReader")
     {
       mitk::ThreeDnTDICOMSeriesReader::Pointer reader;
       if (useDecimalPlacesForOrientation)
         reader = mitk::ThreeDnTDICOMSeriesReader::New(decimalPlacesForOrientation);
       else
         reader = mitk::ThreeDnTDICOMSeriesReader::New();
 
       return ConfigureThreeDnTDICOMSeriesReader(reader, rootElement).GetPointer();
     }
     else
     if (classname == "DICOMITKSeriesGDCMReader")
     {
       bool simpleVolumeImport = QueryBooleanAttribute(rootElement, "simpleVolumeImport", mitk::DICOMITKSeriesGDCMReader::GetDefaultSimpleVolumeImport());
 
       mitk::DICOMITKSeriesGDCMReader::Pointer reader;
       if (useDecimalPlacesForOrientation)
         reader = mitk::DICOMITKSeriesGDCMReader::New( decimalPlacesForOrientation, simpleVolumeImport );
       else
         reader = mitk::DICOMITKSeriesGDCMReader::New( mitk::DICOMITKSeriesGDCMReader::GetDefaultDecimalPlacesForOrientation(), simpleVolumeImport );
 
       // simple volume import that ignores number of frames and inter slice distance
 
       return ConfigureDICOMITKSeriesGDCMReader(reader, rootElement).GetPointer();
     }
     else
     {
       MITK_ERROR << "DICOMFileReader tag names unknown class '" << classname << "'";
       return nullptr;
     }
   }
   else
   {
     MITK_ERROR << "Great confusion: no root element in XML document. Expecting a DICOMFileReader tag at top-level.";
     return nullptr;
   }
 }
 
 #define boolStringTrue(s) \
   (   s == "true" || s == "on" || s == "1" \
    || s == "TRUE" || s == "ON")
 
 bool
 mitk::DICOMReaderConfigurator
-::QueryBooleanAttribute(const TiXmlElement* element, const char* attributeName, bool defaultValue) const
+::QueryBooleanAttribute(const tinyxml2::XMLElement* element, const char* attributeName, bool defaultValue) const
 {
   bool value(defaultValue);
-  const char* valueC = element->Attribute(attributeName);
-  if (valueC)
+  const auto* valueC = element->Attribute(attributeName);
+
+  if (nullptr != valueC)
   {
-    std::string valueS(valueC);
+    std::string valueS = valueC;
     value = boolStringTrue(valueS);
   }
+
   return value;
 }
 
 void
 mitk::DICOMReaderConfigurator
-::ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const
+::ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement* element) const
 {
   // add the "group3DnT" flag
   bool group3DnT = QueryBooleanAttribute(element, "group3DnT", ThreeDnTDICOMSeriesReader::GetDefaultGroup3DandT());
 
   reader->SetGroup3DandT( group3DnT );
 
   // add the "onlyCondenseSameSeries" flag
   bool onlyCondenseSameSeries = QueryBooleanAttribute(element, "onlyCondenseSameSeries", ThreeDnTDICOMSeriesReader::GetDefaultOnlyCondenseSameSeries());
 
   reader->SetOnlyCondenseSameSeries(onlyCondenseSameSeries);
 }
 
 mitk::ThreeDnTDICOMSeriesReader::Pointer
 mitk::DICOMReaderConfigurator
-::ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const
+::ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement* element) const
 {
   assert(element);
 
   // use all the base class configuration
   if (this->ConfigureDICOMITKSeriesGDCMReader( reader.GetPointer(), element ).IsNull())
   {
     return nullptr;
   }
 
   this->ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(reader,element);
   return reader;
 }
 
 void
 mitk::DICOMReaderConfigurator
-::ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const
+::ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement* element) const
 {
   assert(element);
 
   const char* configLabelC = element->Attribute("label");
   if (configLabelC)
   {
     std::string configLabel(configLabelC);
     reader->SetConfigurationLabel(configLabel);
   }
 
   const char* configDescriptionC = element->Attribute("description");
   if (configDescriptionC)
   {
     reader->SetConfigurationDescription(configDescriptionC);
   }
 
   // "fixTiltByShearing" flag
   bool fixTiltByShearing = QueryBooleanAttribute(element, "fixTiltByShearing", DICOMITKSeriesGDCMReader::GetDefaultFixTiltByShearing());
 
   reader->SetFixTiltByShearing( fixTiltByShearing );
 }
 
 mitk::DICOMITKSeriesGDCMReader::Pointer
 mitk::DICOMReaderConfigurator
-::ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const
+::ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement* element) const
 {
   assert(element);
 
   this->ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(reader, element);
 
   // "acceptTwoSlicesGroups" flag
   bool acceptTwoSlicesGroups = QueryBooleanAttribute(element, "acceptTwoSlicesGroups", true);
 
   reader->SetAcceptTwoSlicesGroups( acceptTwoSlicesGroups );
 
   // "toleratedOriginError" attribute (double)
   bool toleratedOriginErrorIsAbsolute = QueryBooleanAttribute(element, "toleratedOriginErrorIsAbsolute", false);
 
   double toleratedOriginError(0.3);
-  if (element->QueryDoubleAttribute("toleratedOriginError", &toleratedOriginError) == TIXML_SUCCESS) // attribute present and a double value
+  if (element->QueryDoubleAttribute("toleratedOriginError", &toleratedOriginError) == tinyxml2::XML_SUCCESS) // attribute present and a double value
   {
     if (toleratedOriginErrorIsAbsolute)
     {
       reader->SetToleratedOriginOffset( toleratedOriginError );
     }
     else
     {
       reader->SetToleratedOriginOffsetToAdaptive( toleratedOriginError );
     }
   }
 
   // DICOMTagBasedSorters are the only thing we create at this point
   // TODO for-loop over all child elements of type DICOMTagBasedSorter, BUT actually a single sorter of this type is enough.
-  TiXmlElement* dElement = element->FirstChildElement("DICOMDatasetSorter");
+  auto* dElement = element->FirstChildElement("DICOMDatasetSorter");
   if (dElement)
   {
     const char* classnameC = dElement->Attribute("class");
     if (!classnameC)
     {
       MITK_ERROR << "File should name a DICOMDatasetSorter class in the class attribute of <DICOMDatasetSorter class=\"...\">. Found nothing instead";
       return nullptr;
     }
 
     std::string classname(classnameC);
 
     if (classname == "DICOMTagBasedSorter")
     {
       DICOMTagBasedSorter::Pointer tagSorter = CreateDICOMTagBasedSorter(dElement);
       if (tagSorter.IsNotNull())
       {
         reader->AddSortingElement( tagSorter );
       }
     }
     else
     {
       MITK_ERROR << "DICOMDatasetSorter tag names unknown class '" << classname << "'";
       return nullptr;
     }
   }
 
   return reader;
 }
 
 mitk::DICOMTagBasedSorter::Pointer
 mitk::DICOMReaderConfigurator
-::CreateDICOMTagBasedSorter(TiXmlElement* element) const
+::CreateDICOMTagBasedSorter(const tinyxml2::XMLElement* element) const
 {
   mitk::DICOMTagBasedSorter::Pointer tagSorter = mitk::DICOMTagBasedSorter::New();
 
   // "strictSorting" parameter!
   bool strictSorting = QueryBooleanAttribute(element, "strictSorting", mitk::DICOMTagBasedSorter::GetDefaultStrictSorting());
   tagSorter->SetStrictSorting(strictSorting);
 
   // "strictSorting" parameter!
   bool expectDistanceOne = QueryBooleanAttribute(element, "expectDistanceOne", mitk::DICOMTagBasedSorter::GetDefaultExpectDistanceOne());
   tagSorter->SetExpectDistanceOne(expectDistanceOne);
 
-  TiXmlElement* dElement = element->FirstChildElement("Distinguishing");
+  auto* dElement = element->FirstChildElement("Distinguishing");
   if (dElement)
   {
-    for ( TiXmlElement* tChild = dElement->FirstChildElement();
+    for ( auto* tChild = dElement->FirstChildElement();
           tChild != nullptr;
           tChild = tChild->NextSiblingElement() )
     {
       try
       {
         mitk::DICOMTag tag = tagFromXMLElement(tChild);
         int i(5);
-        if (tChild->QueryIntAttribute("cutDecimalPlaces", &i) == TIXML_SUCCESS)
+        if (tChild->QueryIntAttribute("cutDecimalPlaces", &i) == tinyxml2::XML_SUCCESS)
         {
           tagSorter->AddDistinguishingTag( tag, new mitk::DICOMTagBasedSorter::CutDecimalPlaces(i) );
         }
         else
         {
           tagSorter->AddDistinguishingTag( tag );
         }
       }
       catch(...)
       {
         return nullptr;
       }
     }
   }
 
   // "sorting tags"
-  TiXmlElement* sElement = element->FirstChildElement("Sorting");
+  auto* sElement = element->FirstChildElement("Sorting");
   if (sElement)
   {
     DICOMSortCriterion::Pointer previousCriterion;
     DICOMSortCriterion::Pointer currentCriterion;
 
-    for ( TiXmlNode* tChildNode = sElement->LastChild();
+    for ( auto* tChildNode = sElement->LastChild();
         tChildNode != nullptr;
         tChildNode = tChildNode->PreviousSibling() )
     {
-      TiXmlElement* tChild = tChildNode->ToElement();
+      auto* tChild = tChildNode->ToElement();
       if (!tChild) continue;
 
       if (!strcmp(tChild->Value(), "Tag"))
       {
         try
         {
           currentCriterion = this->CreateDICOMSortByTag(tChild, previousCriterion);
         }
         catch(...)
         {
           std::stringstream ss;
-          ss << "Could not parse <Tag> element at (input line " << tChild->Row() << ", col. " << tChild->Column() << ")!";
+          ss << "Could not parse <Tag> element at input line " << tChild->GetLineNum() << "!";
           MITK_ERROR << ss.str();
           return nullptr;
         }
       }
       else
       if (!strcmp(tChild->Value(), "ImagePositionPatient"))
       {
         try
         {
           currentCriterion = this->CreateSortByImagePositionPatient(tChild, previousCriterion);
         }
         catch(...)
         {
           std::stringstream ss;
-          ss << "Could not parse <ImagePositionPatient> element at (input line " << tChild->Row() << ", col. " << tChild->Column() << ")!";
+          ss << "Could not parse <ImagePositionPatient> element at input line " << tChild->GetLineNum() << "!";
           MITK_ERROR << ss.str();
           return nullptr;
         }
       }
       else
       {
         MITK_ERROR << "File contain unknown tag <" << tChild->Value()  << "> tag as child to <Sorting>! Cannot interpret...";
       }
 
       previousCriterion = currentCriterion;
     }
 
     tagSorter->SetSortCriterion( currentCriterion.GetPointer() );
   }
 
   return tagSorter;
 }
 
 std::string
 mitk::DICOMReaderConfigurator
-::requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const
+::requiredStringAttribute(const tinyxml2::XMLElement* xmlElement, const std::string& key) const
 {
   assert(xmlElement);
 
   const char* gC = xmlElement->Attribute(key.c_str());
   if (gC)
   {
     std::string gS(gC);
     return gS;
   }
   else
   {
     std::stringstream ss;
-    ss << "Expected an attribute '" << key << "' at this position "
-          "(input line " << xmlElement->Row() << ", col. " << xmlElement->Column() << ")!";
+    ss << "Expected an attribute '" << key << "' at "
+          "input line " << xmlElement->GetLineNum() << "!";
     MITK_ERROR << ss.str();
     throw std::invalid_argument( ss.str() );
   }
 }
 
 unsigned int
 mitk::DICOMReaderConfigurator
 ::hexStringToUInt(const std::string& s) const
 {
   std::stringstream converter(s);
   unsigned int ui;
   converter >> std::hex >> ui;
   MITK_DEBUG << "Converted string '" << s << "' to unsigned int " << ui;
   return ui;
 }
 
 mitk::DICOMTag
 mitk::DICOMReaderConfigurator
-::tagFromXMLElement(TiXmlElement* xmlElement) const
+::tagFromXMLElement(const tinyxml2::XMLElement* xmlElement) const
 {
   assert(xmlElement);
 
   if (strcmp(xmlElement->Value(), "Tag")) // :-( no std::string methods
   {
     std::stringstream ss;
-    ss << "Expected a <Tag group=\"..\" element=\"..\"> tag at this position "
-          "(input line " << xmlElement->Row() << ", col. " << xmlElement->Column() << ")!";
+    ss << "Expected a <Tag group=\"..\" element=\"..\"> tag at "
+          "input line " << xmlElement->GetLineNum() << "!";
     MITK_ERROR << ss.str();
     throw std::invalid_argument( ss.str() );
   }
 
   std::string groupS = requiredStringAttribute(xmlElement, "group");
   std::string elementS = requiredStringAttribute(xmlElement, "element");
 
   try
   {
     // convert string to int (assuming string is in hex format with leading "0x" like "0x0020")
     unsigned int group = hexStringToUInt(groupS);
     unsigned int element = hexStringToUInt(elementS);
     return DICOMTag(group, element);
   }
   catch(...)
   {
     std::stringstream ss;
     ss << "Expected group and element values in <Tag group=\"..\" element=\"..\"> to be hexadecimal with leading 0x, e.g. '0x0020'"
-          "(input line " << xmlElement->Row() << ", col. " << xmlElement->Column() << ")!";
+          "(input line " << xmlElement->GetLineNum() << ")!";
     MITK_ERROR << ss.str();
     throw std::invalid_argument( ss.str() );
   }
 }
 
 mitk::DICOMSortCriterion::Pointer
 mitk::DICOMReaderConfigurator
-::CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const
+::CreateDICOMSortByTag(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const
 {
   mitk::DICOMTag tag = tagFromXMLElement(xmlElement);
   return DICOMSortByTag::New(tag, secondaryCriterion).GetPointer();
 }
 
 mitk::DICOMSortCriterion::Pointer
 mitk::DICOMReaderConfigurator
-::CreateSortByImagePositionPatient(TiXmlElement*, DICOMSortCriterion::Pointer secondaryCriterion) const
+::CreateSortByImagePositionPatient(const tinyxml2::XMLElement*, DICOMSortCriterion::Pointer secondaryCriterion) const
 {
   return SortByImagePositionPatient::New(secondaryCriterion).GetPointer();
 }
 
 
 
 std::string
 mitk::DICOMReaderConfigurator
 ::CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const
 {
   // check possible sub-classes from the most-specific one up to the most generic one
   const DICOMFileReader* cPointer = reader;
-  TiXmlElement* root;
+  tinyxml2::XMLDocument document;
+  tinyxml2::XMLElement* root = nullptr;
   if (const auto* specificReader = dynamic_cast<const ClassicDICOMSeriesReader*>(cPointer))
   {
-    root = this->CreateConfigStringFromReader(specificReader);
+    root = this->CreateConfigStringFromReader(document, specificReader);
   }
   else
   if (const auto* specificReader = dynamic_cast<const ThreeDnTDICOMSeriesReader*>(cPointer))
   {
-    root = this->CreateConfigStringFromReader(specificReader);
+    root = this->CreateConfigStringFromReader(document, specificReader);
   }
   else
   if (const auto* specificReader = dynamic_cast<const DICOMITKSeriesGDCMReader*>(cPointer))
   {
-    root = this->CreateConfigStringFromReader(specificReader);
+    root = this->CreateConfigStringFromReader(document, specificReader);
   }
   else
   {
     MITK_WARN << "Unknown reader class passed to DICOMReaderConfigurator::CreateConfigStringFromReader(). Cannot serialize.";
     return ""; // no serialization, what a pity
   }
 
-  if (root)
+  if (nullptr != root)
   {
-    TiXmlDocument document;
-    document.LinkEndChild( root );
+    document.InsertEndChild( root );
 
-    TiXmlPrinter printer;
-    printer.SetIndent( "  " );
+    tinyxml2::XMLPrinter printer;
+    document.Print(&printer);
 
-    document.Accept( &printer );
     std::string xmltext = printer.CStr();
     return xmltext;
   }
   else
   {
     MITK_WARN << "DICOMReaderConfigurator::CreateConfigStringFromReader() created empty serialization. Problem?";
     return "";
   }
 }
 
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const
+::CreateConfigStringFromReader(tinyxml2::XMLDocument &doc, const DICOMITKSeriesGDCMReader* reader) const
 {
-  TiXmlElement* root = this->CreateDICOMFileReaderTag(reader);
+  auto* root = this->CreateDICOMFileReaderTag(doc, reader);
   assert(root);
 
-  root->SetAttribute("fixTiltByShearing", toString(reader->GetFixTiltByShearing()));
-  root->SetAttribute("acceptTwoSlicesGroups", toString(reader->GetAcceptTwoSlicesGroups()));
-  root->SetDoubleAttribute("toleratedOriginError", reader->GetToleratedOriginError());
-  root->SetAttribute("toleratedOriginErrorIsAbsolute", toString(reader->IsToleratedOriginOffsetAbsolute()));
-  root->SetDoubleAttribute("decimalPlacesForOrientation", reader->GetDecimalPlacesForOrientation());
+  root->SetAttribute("fixTiltByShearing", reader->GetFixTiltByShearing());
+  root->SetAttribute("acceptTwoSlicesGroups", reader->GetAcceptTwoSlicesGroups());
+  root->SetAttribute("toleratedOriginError", reader->GetToleratedOriginError());
+  root->SetAttribute("toleratedOriginErrorIsAbsolute", reader->IsToleratedOriginOffsetAbsolute());
+  root->SetAttribute("decimalPlacesForOrientation", reader->GetDecimalPlacesForOrientation());
 
   // iterate DICOMDatasetSorter objects
   DICOMITKSeriesGDCMReader::ConstSorterList sorterList = reader->GetFreelyConfiguredSortingElements();
   for(auto sorterIter = sorterList.begin();
       sorterIter != sorterList.end();
       ++sorterIter)
   {
     const DICOMDatasetSorter* sorter = *sorterIter;
     if (const auto* specificSorter = dynamic_cast<const DICOMTagBasedSorter*>(sorter))
     {
-      TiXmlElement* sorterTag = this->CreateConfigStringFromDICOMDatasetSorter(specificSorter);
-      root->LinkEndChild(sorterTag);
+      auto* sorterTag = this->CreateConfigStringFromDICOMDatasetSorter(doc, specificSorter);
+      root->InsertEndChild(sorterTag);
     }
     else
     {
       MITK_WARN << "Unknown DICOMDatasetSorter class passed to DICOMReaderConfigurator::CreateConfigStringFromReader(). Cannot serialize.";
       return nullptr;
     }
   }
 
   return root;
 }
 
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const
+::CreateConfigStringFromDICOMDatasetSorter(tinyxml2::XMLDocument &doc, const DICOMTagBasedSorter* sorter) const
 {
   assert(sorter);
 
-  auto  sorterTag = new TiXmlElement("DICOMDatasetSorter");
+  auto *sorterTag = doc.NewElement("DICOMDatasetSorter");
   sorterTag->SetAttribute("class", sorter->GetNameOfClass());
-  sorterTag->SetAttribute("strictSorting", toString(sorter->GetStrictSorting()));
-  sorterTag->SetAttribute("expectDistanceOne", toString(sorter->GetExpectDistanceOne()));
+  sorterTag->SetAttribute("strictSorting", sorter->GetStrictSorting());
+  sorterTag->SetAttribute("expectDistanceOne", sorter->GetExpectDistanceOne());
 
-  auto  distinguishingTagsElement = new TiXmlElement("Distinguishing");
-  sorterTag->LinkEndChild(distinguishingTagsElement);
+  auto *distinguishingTagsElement = doc.NewElement("Distinguishing");
+  sorterTag->InsertEndChild(distinguishingTagsElement);
   mitk::DICOMTagList distinguishingTags = sorter->GetDistinguishingTags();
   for (auto tagIter = distinguishingTags.begin();
        tagIter != distinguishingTags.end();
        ++tagIter)
   {
-    TiXmlElement* tag = this->CreateConfigStringFromDICOMTag(*tagIter);
-    distinguishingTagsElement->LinkEndChild(tag);
+    auto* tag = this->CreateConfigStringFromDICOMTag(doc, *tagIter);
+    distinguishingTagsElement->InsertEndChild(tag);
 
     const DICOMTagBasedSorter::TagValueProcessor* processor = sorter->GetTagValueProcessorForDistinguishingTag(*tagIter);
     if (const auto* specificProcessor = dynamic_cast<const DICOMTagBasedSorter::CutDecimalPlaces*>(processor))
     {
-      tag->SetDoubleAttribute("cutDecimalPlaces", specificProcessor->GetPrecision());
+      tag->SetAttribute("cutDecimalPlaces", specificProcessor->GetPrecision());
     }
   }
 
-  auto  sortingElement = new TiXmlElement("Sorting");
-  sorterTag->LinkEndChild(sortingElement);
+  auto *sortingElement = doc.NewElement("Sorting");
+  sorterTag->InsertEndChild(sortingElement);
   mitk::DICOMSortCriterion::ConstPointer sortCriterion = sorter->GetSortCriterion();
   while (sortCriterion.IsNotNull())
   {
     std::string classname = sortCriterion->GetNameOfClass();
     if (classname == "SortByImagePositionPatient")
     {
-      sortingElement->LinkEndChild( new TiXmlElement("ImagePositionPatient") ); // no parameters
+      sortingElement->InsertEndChild( doc.NewElement("ImagePositionPatient") ); // no parameters
     }
     else
     if (classname == "DICOMSortByTag")
     {
       DICOMTagList pseudoTagList = sortCriterion->GetTagsOfInterest();
       if (pseudoTagList.size() == 1)
       {
         DICOMTag firstTag = pseudoTagList.front();
 
-        TiXmlElement* tagElement = this->CreateConfigStringFromDICOMTag(firstTag);
+        auto* tagElement = this->CreateConfigStringFromDICOMTag(doc, firstTag);
 
-        sortingElement->LinkEndChild( tagElement );
+        sortingElement->InsertEndChild( tagElement );
       }
       else
       {
         MITK_ERROR << "Encountered SortByTag class with MULTIPLE tag in CreateConfigStringFromDICOMDatasetSorter. Cannot serialize.";
         return nullptr;
       }
     }
     else
     {
       MITK_ERROR << "Encountered unknown class '" << classname << "' in CreateConfigStringFromDICOMDatasetSorter. Cannot serialize.";
       return nullptr;
     }
 
     sortCriterion = sortCriterion->GetSecondaryCriterion();
   }
 
   return sorterTag;
 }
 
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateConfigStringFromDICOMTag(const DICOMTag& tag) const
+::CreateConfigStringFromDICOMTag(tinyxml2::XMLDocument& doc, const DICOMTag& tag) const
 {
-  auto  tagElement = new TiXmlElement("Tag"); // name group element
+  auto  tagElement = doc.NewElement("Tag"); // name group element
   tagElement->SetAttribute("name", tag.GetName().c_str());
-  tagElement->SetAttribute("group", toHexString(tag.GetGroup()));
-  tagElement->SetAttribute("element", toHexString(tag.GetElement()));
+  tagElement->SetAttribute("group", toHexString(tag.GetGroup()).c_str());
+  tagElement->SetAttribute("element", toHexString(tag.GetElement()).c_str());
   return tagElement;
 }
 
 std::string
 mitk::DICOMReaderConfigurator
 ::toHexString(unsigned int i) const
 {
   std::stringstream ss;
   ss << "0x" << std::setfill ('0') << std::setw(4) << std::hex << i;
   return ss.str();
 }
 
 
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const
+::CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ThreeDnTDICOMSeriesReader* reader) const
 {
-  TiXmlElement* root = this->CreateConfigStringFromReader(static_cast<const DICOMITKSeriesGDCMReader*>(reader));
+  auto* root = this->CreateConfigStringFromReader(doc, static_cast<const DICOMITKSeriesGDCMReader*>(reader));
   assert(root);
 
-  root->SetAttribute("group3DnT", toString(reader->GetGroup3DandT()));
+  root->SetAttribute("group3DnT", reader->GetGroup3DandT());
 
   return root;
 }
 
-const char*
-mitk::DICOMReaderConfigurator
-::toString(bool b) const
-{
-  return b ? "true" : "false";
-}
-
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const
+::CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ClassicDICOMSeriesReader* reader) const
 {
-  return this->CreateDICOMFileReaderTag(reader);
+  return this->CreateDICOMFileReaderTag(doc, reader);
 }
 
-TiXmlElement*
+tinyxml2::XMLElement*
 mitk::DICOMReaderConfigurator
-::CreateDICOMFileReaderTag(const DICOMFileReader* reader) const
+::CreateDICOMFileReaderTag(tinyxml2::XMLDocument& doc, const DICOMFileReader* reader) const
 {
-  auto  readerTag = new TiXmlElement("DICOMFileReader");
+  auto readerTag = doc.NewElement("DICOMFileReader");
   readerTag->SetAttribute("class", reader->GetNameOfClass());
   readerTag->SetAttribute("label", reader->GetConfigurationLabel().c_str());
   readerTag->SetAttribute("description", reader->GetConfigurationDescription().c_str());
   readerTag->SetAttribute("version", "1");
 
   return readerTag;
 }
diff --git a/Modules/IGT/CMakeLists.txt b/Modules/IGT/CMakeLists.txt
index 760efba59f..a9eca5afcc 100644
--- a/Modules/IGT/CMakeLists.txt
+++ b/Modules/IGT/CMakeLists.txt
@@ -1,63 +1,69 @@
 include(MITKIGTHardware.cmake)
 
 if(MITK_USE_MICRON_TRACKER)
   set(ADDITIONAL_INCLUDE_DIRS ${ADDITIONAL_INCLUDE_DIRS} ${MITK_MICRON_TRACKER_INCLUDE_DIR})
   set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_MICRON_TRACKER_LIB})
 endif(MITK_USE_MICRON_TRACKER)
 
 if(MITK_USE_OPTITRACK_TRACKER)
   set(ADDITIONAL_INCLUDE_DIRS ${ADDITIONAL_INCLUDE_DIRS} ${MITK_OPTITRACK_TRACKER_INCLUDE_DIR})
   set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_OPTITRACK_TRACKER_LIB})
   add_definitions( -DMITK_USE_OPTITRACK_TRACKER )
 endif(MITK_USE_OPTITRACK_TRACKER)
 
 if(MITK_USE_MICROBIRD_TRACKER)
   set(ADDITIONAL_INCLUDE_DIRS ${ADDITIONAL_INCLUDE_DIRS} ${MITK_USE_MICROBIRD_TRACKER_INCLUDE_DIR})
   set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_USE_MICROBIRD_TRACKER_LIB})
 endif(MITK_USE_MICROBIRD_TRACKER)
 
 if(MITK_USE_POLHEMUS_TRACKER)
   set(ADDITIONAL_INCLUDE_DIRS ${ADDITIONAL_INCLUDE_DIRS} ${MITK_POLHEMUS_TRACKER_INCLUDE_DIR})
   set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${MITK_POLHEMUS_TRACKER_LIB})
 endif(MITK_USE_POLHEMUS_TRACKER)
 
 MITK_CREATE_MODULE(
   INCLUDE_DIRS
     PUBLIC Algorithms Common DataManagement ExceptionHandling IO Rendering TrackingDevices TestingHelper
     PRIVATE ${ADDITIONAL_INCLUDE_DIRS}
   DEPENDS PUBLIC MitkImageStatistics MitkSceneSerialization MitkIGTBase MitkOpenIGTLink
-  PACKAGE_DEPENDS ITK|ITKRegistrationCommon tinyxml OpenIGTLink
+  PACKAGE_DEPENDS ITK|ITKRegistrationCommon tinyxml2|tinyxml2 OpenIGTLink
   ADDITIONAL_LIBS "${ADDITIONAL_LIBS}"
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
+
 if(MitkIGT_IS_ENABLED)
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/ClaronMicron.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/IntuitiveDaVinci.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAurora.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAurora_Dome.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraCompactFG_Dome.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraPlanarFG_Dome.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraTabletopFG_Dome.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIAuroraTabletopFG_Prototype_Dome.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisOldModel.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisSpectra.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisSpectraExtendedPyramid.stl )
   MITK_INSTALL(FILES ${MITK_SOURCE_DIR}/Modules/IGT/Resources/NDIPolarisVicra.stl )
 endif()
 
 if(NOT MODULE_IS_ENABLED)
   message(STATUS "IGTTutorialStep1 won't be built. Missing: ${_RESULT}")
 else()
 ## create IGT config
 configure_file(mitkIGTConfig.h.in ${PROJECT_BINARY_DIR}/mitkIGTConfig.h @ONLY)
 
 # add test programm for serial communication classADD_EXECUTABLE(SerialCommunicationTest IGTTrackingDevices/mitkSerialCommunicationTest.cpp)target_link_libraries(SerialCommunicationTest mitkIGT Mitk tinyxml PocoXML)
 
 add_subdirectory(autoload/DeviceRegistry)
 
 add_subdirectory(Tutorial)
 
 add_subdirectory(Testing)
 
 endif()
 
diff --git a/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.cpp b/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.cpp
index c10728cf92..0f9609216a 100644
--- a/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.cpp
+++ b/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.cpp
@@ -1,362 +1,364 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkNavigationDataRecorderDeprecated.h"
 #include <fstream>
 #include <mitkIGTTimeStamp.h>
-#include <tinyxml.h>
+#include <tinyxml2.h>
 #include <itksys/SystemTools.hxx>
 
 //headers for exceptions
 #include "mitkIGTException.h"
 #include "mitkIGTIOException.h"
 
 mitk::NavigationDataRecorderDeprecated::NavigationDataRecorderDeprecated()
 {
   //set default values
   m_NumberOfInputs = 0;
   m_RecordingMode = NormalFile;
   m_Recording = false;
   m_NumberOfRecordedFiles = 0;
   m_Stream = nullptr;
   m_FileName = "";
   m_SystemTimeClock = RealTimeClock::New();
   m_OutputFormat = mitk::NavigationDataRecorderDeprecated::xml;
   m_RecordCounter = 0;
   m_RecordCountLimit = -1;
   m_DoNotOverwriteFiles = false;
   m_StreamMustBeDeleted = false;
 
   //To get a start time
   mitk::IGTTimeStamp::GetInstance()->Start(this);
 }
 
 mitk::NavigationDataRecorderDeprecated::~NavigationDataRecorderDeprecated()
 {
 }
 
 
 void mitk::NavigationDataRecorderDeprecated::GenerateData()
 {
 
 }
 
 void mitk::NavigationDataRecorderDeprecated::AddNavigationData( const NavigationData* nd )
 {
   // Process object is not const-correct so the const_cast is required here
   this->SetNthInput(m_NumberOfInputs,
     const_cast< mitk::NavigationData * >( nd ) );
 
   m_NumberOfInputs++;
 
   this->Modified();
 }
 
 void mitk::NavigationDataRecorderDeprecated::SetRecordingMode( RecordingMode mode )
 {
   m_RecordingMode = mode;
   this->Modified();
 }
 
 void mitk::NavigationDataRecorderDeprecated::Update()
 {
   if (m_Recording)
   {
     DataObjectPointerArray inputs = this->GetInputs(); //get all inputs
     mitk::NavigationData::TimeStampType timestamp=0.0; // timestamp for mitk time
     timestamp = mitk::IGTTimeStamp::GetInstance()->GetElapsed();
 
 
     mitk::NavigationData::TimeStampType sysTimestamp = 0.0; // timestamp for system time
     sysTimestamp = m_SystemTimeClock->GetCurrentStamp();
 
     // cast system time double value to stringstream to avoid low precision rounding
     std::ostringstream strs;
     strs.precision(15); // rounding precision for system time double value
     strs << sysTimestamp;
     std::string sysTimeStr = strs.str();
 
     //if csv-mode: write csv header and timestamp at beginning
     if (m_OutputFormat == mitk::NavigationDataRecorderDeprecated::csv)
       {
       //write header only when it's the first line
       if (m_firstLine)
         {
         m_firstLine = false;
         *m_Stream << "TimeStamp";
         for (unsigned int index = 0; index < inputs.size(); index++){ *m_Stream << ";Valid_Tool" << index <<
                                                                                 ";X_Tool" << index <<
                                                                                 ";Y_Tool" << index <<
                                                                                 ";Z_Tool" << index <<
                                                                                 ";QX_Tool" << index <<
                                                                                 ";QY_Tool" << index <<
                                                                                 ";QZ_Tool" << index <<
                                                                                 ";QR_Tool" << index;}
         *m_Stream << "\n";
         }
       //write timestamp (always)
       *m_Stream << timestamp;
       }
 
     //write tool data for every tool
     for (unsigned int index = 0; index < inputs.size(); index++)
     {
       mitk::NavigationData* nd = dynamic_cast<mitk::NavigationData*>(inputs[index].GetPointer());
       nd->Update(); // call update to propagate update to previous filters
 
       mitk::NavigationData::PositionType position;
       mitk::NavigationData::OrientationType orientation(0.0, 0.0, 0.0, 0.0);
       mitk::NavigationData::CovarianceMatrixType matrix;
 
       bool hasPosition = true;
       bool hasOrientation = true;
       bool dataValid = false;
 
       position.Fill(0.0);
       matrix.SetIdentity();
 
       position = nd->GetPosition();
       orientation = nd->GetOrientation();
       matrix = nd->GetCovErrorMatrix();
 
       hasPosition = nd->GetHasPosition();
       hasOrientation = nd->GetHasOrientation();
       dataValid = nd->IsDataValid();
 
       //use this one if you want the timestamps of the source
       //timestamp = nd->GetIGTTimeStamp();
 
       //a timestamp is never < 0! this case happens only if you are using the timestamp of the nd object instead of getting a new one
       if (timestamp >= 0)
       {
         if (this->m_OutputFormat == mitk::NavigationDataRecorderDeprecated::xml)
-          {
-          auto  elem = new TiXmlElement("NavigationData");
-
-          elem->SetDoubleAttribute("Time", timestamp);
-          elem->SetAttribute("SystemTime", sysTimeStr); // tag for system time
-          elem->SetDoubleAttribute("Tool", index);
-          elem->SetDoubleAttribute("X", position[0]);
-          elem->SetDoubleAttribute("Y", position[1]);
-          elem->SetDoubleAttribute("Z", position[2]);
-
-          elem->SetDoubleAttribute("QX", orientation[0]);
-          elem->SetDoubleAttribute("QY", orientation[1]);
-          elem->SetDoubleAttribute("QZ", orientation[2]);
-          elem->SetDoubleAttribute("QR", orientation[3]);
-
-          elem->SetDoubleAttribute("C00", matrix[0][0]);
-          elem->SetDoubleAttribute("C01", matrix[0][1]);
-          elem->SetDoubleAttribute("C02", matrix[0][2]);
-          elem->SetDoubleAttribute("C03", matrix[0][3]);
-          elem->SetDoubleAttribute("C04", matrix[0][4]);
-          elem->SetDoubleAttribute("C05", matrix[0][5]);
-          elem->SetDoubleAttribute("C10", matrix[1][0]);
-          elem->SetDoubleAttribute("C11", matrix[1][1]);
-          elem->SetDoubleAttribute("C12", matrix[1][2]);
-          elem->SetDoubleAttribute("C13", matrix[1][3]);
-          elem->SetDoubleAttribute("C14", matrix[1][4]);
-          elem->SetDoubleAttribute("C15", matrix[1][5]);
+        {
+          tinyxml2::XMLDocument doc;
+          auto *elem = doc.NewElement("NavigationData");
+
+          elem->SetAttribute("Time", timestamp);
+          elem->SetAttribute("SystemTime", sysTimeStr.c_str()); // tag for system time
+          elem->SetAttribute("Tool", index);
+          elem->SetAttribute("X", position[0]);
+          elem->SetAttribute("Y", position[1]);
+          elem->SetAttribute("Z", position[2]);
+
+          elem->SetAttribute("QX", orientation[0]);
+          elem->SetAttribute("QY", orientation[1]);
+          elem->SetAttribute("QZ", orientation[2]);
+          elem->SetAttribute("QR", orientation[3]);
+
+          elem->SetAttribute("C00", matrix[0][0]);
+          elem->SetAttribute("C01", matrix[0][1]);
+          elem->SetAttribute("C02", matrix[0][2]);
+          elem->SetAttribute("C03", matrix[0][3]);
+          elem->SetAttribute("C04", matrix[0][4]);
+          elem->SetAttribute("C05", matrix[0][5]);
+          elem->SetAttribute("C10", matrix[1][0]);
+          elem->SetAttribute("C11", matrix[1][1]);
+          elem->SetAttribute("C12", matrix[1][2]);
+          elem->SetAttribute("C13", matrix[1][3]);
+          elem->SetAttribute("C14", matrix[1][4]);
+          elem->SetAttribute("C15", matrix[1][5]);
 
           if (dataValid)
             elem->SetAttribute("Valid",1);
           else
             elem->SetAttribute("Valid",0);
 
           if (hasOrientation)
             elem->SetAttribute("hO",1);
           else
             elem->SetAttribute("hO",0);
 
           if (hasPosition)
             elem->SetAttribute("hP",1);
           else
             elem->SetAttribute("hP",0);
 
           // set additional attribute?
           auto
               it = m_AdditionalAttributes.find( nd );
           if( it != m_AdditionalAttributes.end() )
           {
-            elem->SetAttribute(it->second.first, it->second.second);
+            elem->SetAttribute(it->second.first.c_str(), it->second.second.c_str());
           }
 
-          *m_Stream << "        " << *elem << std::endl;
+          tinyxml2::XMLPrinter printer;
+          doc.Print(&printer);
 
-          delete elem;
+          *m_Stream << "        " << printer.CStr() << std::endl;
           }
         else if (this->m_OutputFormat == mitk::NavigationDataRecorderDeprecated::csv)
           {
           *m_Stream << ";" << dataValid << ";" << position[0] << ";" << position[1] << ";" << position[2] << ";" << orientation[0] << ";" << orientation[1] << ";" << orientation[2] << ";" << orientation[3];
           }
       }
     }
     if (this->m_OutputFormat == mitk::NavigationDataRecorderDeprecated::csv)
     {
       *m_Stream << "\n";
     }
   }
   m_RecordCounter++;
   if ((m_RecordCountLimit<=m_RecordCounter)&&(m_RecordCountLimit != -1)) {StopRecording();}
 }
 
 void mitk::NavigationDataRecorderDeprecated::SetAdditionalAttribute(const NavigationData* nd,
                                                           const std::string& attributeName
                              , const std::string& attributeValue )
 {
    auto
        it = m_AdditionalAttributes.find( nd );
   if( it == m_AdditionalAttributes.end() )
     m_AdditionalAttributes[nd] = std::pair<std::string, std::string>(attributeName, attributeValue);
   else
   {
     it->second.first = attributeName;
     it->second.second = attributeValue;
   }
 
 }
 
 void mitk::NavigationDataRecorderDeprecated::RemoveAdditionalAttribute( const NavigationData* nd )
 {
   auto
       it = m_AdditionalAttributes.find( nd );
  if( it != m_AdditionalAttributes.end() )
    m_AdditionalAttributes.erase(it);
 }
 
 void mitk::NavigationDataRecorderDeprecated::StartRecording()
 {
 
   if(!m_Recording)
   {
     if (m_Stream == nullptr)
     {
       std::stringstream ss;
       std::ostream* stream;
 
       //An existing extension will be cut and replaced with .xml
       std::string tmpPath = itksys::SystemTools::GetFilenamePath(m_FileName);
       m_FileName = itksys::SystemTools::GetFilenameWithoutExtension(m_FileName);
       std::string extension = ".xml";
       if (m_OutputFormat == mitk::NavigationDataRecorderDeprecated::csv)
         extension = ".csv";
 
       ss << tmpPath << "/" <<  m_FileName << "-" << m_NumberOfRecordedFiles << extension;
 
       if( m_DoNotOverwriteFiles )
       {
         unsigned int index = m_NumberOfRecordedFiles+1;
         while( itksys::SystemTools::FileExists( ss.str().c_str() ) )
         {
           ss.str("");
           ss << tmpPath << "/" <<  m_FileName << "-" << index  << extension;
           index++;
         }
       }
 
       switch(m_RecordingMode)
       {
         case Console:
           stream = &std::cout;
           break;
 
         case NormalFile:
           if (m_FileName == "") //Check if there is a file name and path
           {
             std::string message = "No file name or file path set.";
             MITK_ERROR << message;
             mitkThrowException(mitk::IGTException) << message;
           }
           else
           {
             stream = new std::ofstream(ss.str().c_str());
           }
           break;
 
         case ZipFile:
           stream = &std::cout;
           MITK_WARN << "Sorry no ZipFile support yet";
           break;
 
         default:
           stream = &std::cout;
           break;
       }
       m_Stream = stream;
       m_StreamMustBeDeleted = true;
       m_firstLine = true;
       m_RecordCounter = 0;
       StartRecording(stream);
     }
   }
 else if (m_Recording)
   {
   MITK_WARN << "Already recording please stop before start new recording session";
   return;
   }
 }
 
 void mitk::NavigationDataRecorderDeprecated::StartRecording(std::ostream* stream)
 {
   if (m_Recording)
   {
     MITK_WARN << "Already recording please stop before start new recording session";
     return;
   }
 
   m_Stream = stream;
   m_Stream->precision(10);
 
   //TODO store date and GMT time
   //cheking if the stream is good
   if (m_Stream->good())
   {
     if (m_OutputFormat == mitk::NavigationDataRecorderDeprecated::xml)
       {
       *m_Stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" << std::endl;
       /**m_Stream << "<Version Ver=\"1\" />" << std::endl;*/
       // should be a generic version, meaning a member variable, which has the actual version
       *m_Stream << "    " << "<Data ToolCount=\"" << (m_NumberOfInputs) << "\" version=\"1.0\">" << std::endl;
       }
     m_Recording = true;
   }
   else
   {
    m_Recording = false;
    mitkThrowException(mitk::IGTException)<<"The stream is not good";
   }
 }
 
 
 void mitk::NavigationDataRecorderDeprecated::StopRecording()
 {
   if (!m_Recording)
   {
     std::cout << "You have to start a recording first" << std::endl;
     return;
   }
 
   if ((m_Stream) && (m_OutputFormat == mitk::NavigationDataRecorderDeprecated::xml))
   {
     *m_Stream << "</Data>" << std::endl;
   }
 
   m_NumberOfRecordedFiles++;
   m_Recording = false;
   m_Stream->flush();
   if (m_StreamMustBeDeleted) //stream must only be deleted if it was created inside this class
     {
     m_StreamMustBeDeleted = false;
     delete m_Stream;
     }
   m_Stream = nullptr;
 }
diff --git a/Modules/IGTBase/autoload/IO/CMakeLists.txt b/Modules/IGTBase/autoload/IO/CMakeLists.txt
index e6e391249c..cd58ef13ea 100644
--- a/Modules/IGTBase/autoload/IO/CMakeLists.txt
+++ b/Modules/IGTBase/autoload/IO/CMakeLists.txt
@@ -1,5 +1,11 @@
 MITK_CREATE_MODULE(IGTIO
                    DEPENDS MitkIGTBase
-                   PACKAGE_DEPENDS tinyxml
+                   PACKAGE_DEPENDS tinyxml2|tinyxml2
                    AUTOLOAD_WITH MitkCore
                   )
+
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.cpp b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.cpp
index 24551b7f0a..7195fd995e 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.cpp
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.cpp
@@ -1,364 +1,214 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkNavigationDataReaderXML.h"
 #include <mitkIGTMimeTypes.h>
 #include <mitkLocaleSwitch.h>
 
 // Third Party
 #include <itksys/SystemTools.hxx>
 #include <fstream>
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
-
-mitk::NavigationDataReaderXML::NavigationDataReaderXML() : AbstractFileReader(
-  mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(),
-  "MITK NavigationData Reader (XML)"), m_parentElement(nullptr), m_currentNode(nullptr)
+namespace
 {
-  RegisterService();
-}
+  mitk::NavigationData::Pointer ReadNavigationData(const tinyxml2::XMLElement* ndElem)
+  {
+    if (nullptr == ndElem)
+      return nullptr;
 
-mitk::NavigationDataReaderXML::~NavigationDataReaderXML()
-{
-}
+    mitk::NavigationData::TimeStampType timeStamp = -1;
 
-mitk::NavigationDataReaderXML::NavigationDataReaderXML(const mitk::NavigationDataReaderXML& other) : AbstractFileReader(other), m_parentElement(nullptr), m_currentNode(nullptr)
-{
-}
+    ndElem->QueryDoubleAttribute("Time", &timeStamp);
 
-mitk::NavigationDataReaderXML* mitk::NavigationDataReaderXML::Clone() const
-{
-  return new NavigationDataReaderXML(*this);
-}
+    if (-1 == timeStamp)
+      return nullptr;
 
+    mitk::NavigationData::PositionType position;
+    position.Fill(0.0);
 
-std::vector<itk::SmartPointer<mitk::BaseData>> mitk::NavigationDataReaderXML::DoRead()
-{
-  mitk::NavigationDataSet::Pointer dataset;
-  std::istream* in = GetInputStream();
-  if (in == nullptr)
-  {
-    dataset = Read(GetInputLocation());
-  } else {
-    dataset = Read(in);
-  }
-  std::vector<mitk::BaseData::Pointer> result;
-  mitk::BaseData::Pointer base = dataset.GetPointer();
-  result.push_back(base);
-  return result;
-}
+    ndElem->QueryDoubleAttribute("X", &position[0]);
+    ndElem->QueryDoubleAttribute("Y", &position[1]);
+    ndElem->QueryDoubleAttribute("Z", &position[2]);
 
+    mitk::NavigationData::OrientationType orientation;
 
+    ndElem->QueryDoubleAttribute("QX", &orientation[0]);
+    ndElem->QueryDoubleAttribute("QY", &orientation[1]);
+    ndElem->QueryDoubleAttribute("QZ", &orientation[2]);
+    ndElem->QueryDoubleAttribute("QR", &orientation[3]);
 
-mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::Read(std::string fileName)
-{
-  //define own locale
-  mitk::LocaleSwitch localeSwitch("C");
+    mitk::NavigationData::CovarianceMatrixType matrix;
+    matrix.SetIdentity();
 
-  m_FileName = fileName;
+    ndElem->QueryDoubleAttribute("C00", &matrix[0][0]);
+    ndElem->QueryDoubleAttribute("C01", &matrix[0][1]);
+    ndElem->QueryDoubleAttribute("C02", &matrix[0][2]);
+    ndElem->QueryDoubleAttribute("C03", &matrix[0][3]);
+    ndElem->QueryDoubleAttribute("C04", &matrix[0][4]);
+    ndElem->QueryDoubleAttribute("C05", &matrix[0][5]);
+    ndElem->QueryDoubleAttribute("C10", &matrix[1][0]);
+    ndElem->QueryDoubleAttribute("C11", &matrix[1][1]);
+    ndElem->QueryDoubleAttribute("C12", &matrix[1][2]);
+    ndElem->QueryDoubleAttribute("C13", &matrix[1][3]);
+    ndElem->QueryDoubleAttribute("C14", &matrix[1][4]);
+    ndElem->QueryDoubleAttribute("C15", &matrix[1][5]);
 
-  TiXmlDocument document;
-  if (!document.LoadFile(fileName))
-  {
-    mitkThrowException(mitk::IGTIOException) << "File '" << fileName << "' could not be loaded.";
-  }
+    int attrib = 0;
+    ndElem->QueryIntAttribute("Valid", &attrib);
+    bool isValid = 0 != attrib;
 
-  TiXmlElement* m_DataElem = document.FirstChildElement("Version");
-  if (!m_DataElem)
-  {
-    // for backwards compatibility of version tag
-    m_DataElem = document.FirstChildElement("Data");
-    if (!m_DataElem)
-    {
-      mitkThrowException(mitk::IGTIOException) << "Data element not found.";
-    }
+    attrib = 0;
+    ndElem->QueryIntAttribute("hP", &attrib);
+    bool hasPosition = 0 != attrib;
 
-  }
+    attrib = 0;
+    ndElem->QueryIntAttribute("hO", &attrib);
+    bool hasOrientation = 0 != attrib;
 
-  if (m_DataElem->QueryIntAttribute("Ver", &m_FileVersion) != TIXML_SUCCESS)
-  {
-    if (m_DataElem->QueryIntAttribute("version", &m_FileVersion) != TIXML_SUCCESS)
-    {
-      mitkThrowException(mitk::IGTIOException) << "Version not specified in XML file.";
-    }
-  }
+    auto navData = mitk::NavigationData::New();
 
-  if (m_FileVersion != 1)
-  {
-    mitkThrowException(mitk::IGTIOException) << "File format version " << m_FileVersion << " is not supported.";
-  }
+    navData->SetIGTTimeStamp(timeStamp);
+    navData->SetPosition(position);
+    navData->SetOrientation(orientation);
+    navData->SetCovErrorMatrix(matrix);
+    navData->SetDataValid(isValid);
+    navData->SetHasPosition(hasPosition);
+    navData->SetHasOrientation(hasOrientation);
 
-  m_parentElement = document.FirstChildElement("Data");
-  if (!m_parentElement)
-  {
-    mitkThrowException(mitk::IGTIOException) << "Data element not found.";
+    return navData;
   }
-
-  m_parentElement->QueryIntAttribute("ToolCount", &m_NumberOfOutputs);
-
-  mitk::NavigationDataSet::Pointer navigationDataSet = this->ReadNavigationDataSet();
-
-  return navigationDataSet;
 }
 
-mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::Read(std::istream* stream)
+mitk::NavigationDataReaderXML::NavigationDataReaderXML()
+  : AbstractFileReader(IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), "MITK NavigationData Reader (XML)")
 {
-  //define own locale
-  mitk::LocaleSwitch localeSwitch("C");
-
-  // first get the file version
-  m_FileVersion = this->GetFileVersion(stream);
-
-  // check if we have a valid version: m_FileVersion has to be always bigger than 1 for playing
-  if (m_FileVersion < 1)
-  {
-    StreamInvalid("Playing not possible. Invalid file version!");
-    return nullptr;
-  }
+  this->RegisterService();
+}
 
-  m_NumberOfOutputs = this->GetNumberOfNavigationDatas(stream);
-  if (m_NumberOfOutputs == 0) { return nullptr; }
+mitk::NavigationDataReaderXML::~NavigationDataReaderXML()
+{
+}
 
-  mitk::NavigationDataSet::Pointer dataSet = this->ReadNavigationDataSet();
+mitk::NavigationDataReaderXML::NavigationDataReaderXML(const mitk::NavigationDataReaderXML& other)
+  : AbstractFileReader(other)
+{
+}
 
-  return dataSet;
+mitk::NavigationDataReaderXML* mitk::NavigationDataReaderXML::Clone() const
+{
+  return new NavigationDataReaderXML(*this);
 }
 
-mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::ReadNavigationDataSet()
+std::vector<itk::SmartPointer<mitk::BaseData>> mitk::NavigationDataReaderXML::DoRead()
 {
-  mitk::NavigationDataSet::Pointer navigationDataSet = mitk::NavigationDataSet::New(m_NumberOfOutputs);
-  mitk::NavigationData::Pointer curNavigationData;
+  mitk::NavigationDataSet::Pointer dataset = nullptr == this->GetInputStream()
+    ? this->Read(this->GetInputLocation())
+    : this->Read(*this->GetInputStream());
 
-  do
-    {
-      std::vector<mitk::NavigationData::Pointer> navDatas(m_NumberOfOutputs);
-      for (int n = 0; n < m_NumberOfOutputs; ++n)
-      {
-        curNavigationData = this->ReadVersion1();
+  std::vector<mitk::BaseData::Pointer> result;
+  result.emplace_back(dataset.GetPointer());
 
-        if (curNavigationData.IsNull())
-        {
-          if (n != 0)
-          {
-            MITK_WARN("mitkNavigationDataReaderXML")
-                << "Different number of NavigationData objects for different tools. Ignoring last ones.";
-          }
-          break;
-        }
-        navDatas.at(n) = curNavigationData;
-      }
+  return result;
+}
 
-      if (curNavigationData.IsNotNull())
-      {
-        navigationDataSet->AddNavigationDatas(navDatas);
-      }
-    }
-    while (curNavigationData.IsNotNull());
+mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::Read(const std::string& fileName)
+{
+  std::ifstream stream(fileName);
+  stream.imbue(std::locale::classic());
 
-    return navigationDataSet;
+  return this->Read(stream);
 }
 
-mitk::NavigationData::Pointer mitk::NavigationDataReaderXML::ReadVersion1()
+mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::Read(std::istream& stream)
 {
-  if ( !m_parentElement )
-  {
-    mitkThrowException(mitk::IGTIOException) << "Reading XML is not possible. Parent element is not set.";
-  }
+  std::string string(std::istreambuf_iterator<char>(stream), {});
+  tinyxml2::XMLDocument doc;
+
+  if (tinyxml2::XML_SUCCESS != doc.Parse(string.c_str()))
+    mitkThrowException(IGTIOException) << "Could not parse stream.";
+
+  const auto* rootElem = doc.RootElement();
+  decltype(rootElem) dataElem = nullptr;
 
-  TiXmlElement* elem;
-  m_currentNode = m_parentElement->IterateChildren(m_currentNode);
+  if (nullptr == rootElem)
+    return nullptr;
 
-  bool delElem;
+  int version = 0;
+  auto err = tinyxml2::XML_SUCCESS;
+    
+  std::string rootElemVal = rootElem->Value();
 
-  if(m_currentNode)
+  if ("Version" == rootElemVal)
   {
-    elem = m_currentNode->ToElement();
-    if(elem==nullptr)
-    {
-      mitkThrowException(mitk::IGTException) << "Cannot find element: Is this file damaged?";
-    }
-    delElem = false;
+    err = rootElem->QueryIntAttribute("Ver", &version);
+    dataElem = rootElem->NextSiblingElement("Data");
   }
-
-  else
+  else if ("Data" == rootElemVal)
   {
-    elem = new TiXmlElement("");
-    delElem = true;
+    err = rootElem->QueryIntAttribute("version", &version);
+    dataElem = rootElem;
   }
 
+  if (err != tinyxml2::XML_SUCCESS)
+    mitkThrowException(IGTIOException) << "Could not parse file format version.";
 
-  mitk::NavigationData::Pointer nd = this->ReadNavigationData(elem);
+  if (version != 1)
+    mitkThrowException(IGTIOException) << "File format version " << version << " is not supported.";
 
-  if(delElem) { delete elem; }
+  if (nullptr == dataElem)
+    mitkThrowException(IGTIOException) << "Data element not found.";
 
-  return nd;
-}
+  int toolCount = 0;
 
-mitk::NavigationData::Pointer mitk::NavigationDataReaderXML::ReadNavigationData(TiXmlElement* elem)
-{
-  if (elem == nullptr) {mitkThrow() << "Error: Element is nullptr!";}
-
-  mitk::NavigationData::Pointer nd = mitk::NavigationData::New();
+  if (tinyxml2::XML_SUCCESS != dataElem->QueryIntAttribute("ToolCount", &toolCount))
+    mitkThrowException(IGTIOException) << "ToolCount attribute missing from Data element.";
 
-  mitk::NavigationData::PositionType position;
-  mitk::NavigationData::OrientationType orientation(0.0,0.0,0.0,0.0);
-  mitk::NavigationData::TimeStampType timestamp = -1;
-  mitk::NavigationData::CovarianceMatrixType matrix;
+  if (0 >= toolCount)
+    mitkThrowException(IGTIOException) << "Invalid ToolCount: " << toolCount << ".";
 
-  bool hasPosition = true;
-  bool hasOrientation = true;
-  bool dataValid = false;
+  auto navDataSet = NavigationDataSet::New(static_cast<unsigned int>(toolCount));
+  NavigationData::Pointer navData;
 
-  position.Fill(0.0);
-  matrix.SetIdentity();
+  const auto* ndElem = dataElem->FirstChildElement();
 
-  elem->QueryDoubleAttribute("Time",&timestamp);
-  if (timestamp == -1)
+  if (nullptr != ndElem)
   {
-    return nullptr;  //the calling method should check the return value if it is valid/not nullptr
-  }
-
-  elem->QueryDoubleAttribute("X", &position[0]);
-  elem->QueryDoubleAttribute("Y", &position[1]);
-  elem->QueryDoubleAttribute("Z", &position[2]);
-
-  elem->QueryDoubleAttribute("QX", &orientation[0]);
-  elem->QueryDoubleAttribute("QY", &orientation[1]);
-  elem->QueryDoubleAttribute("QZ", &orientation[2]);
-  elem->QueryDoubleAttribute("QR", &orientation[3]);
-
-  elem->QueryDoubleAttribute("C00", &matrix[0][0]);
-  elem->QueryDoubleAttribute("C01", &matrix[0][1]);
-  elem->QueryDoubleAttribute("C02", &matrix[0][2]);
-  elem->QueryDoubleAttribute("C03", &matrix[0][3]);
-  elem->QueryDoubleAttribute("C04", &matrix[0][4]);
-  elem->QueryDoubleAttribute("C05", &matrix[0][5]);
-  elem->QueryDoubleAttribute("C10", &matrix[1][0]);
-  elem->QueryDoubleAttribute("C11", &matrix[1][1]);
-  elem->QueryDoubleAttribute("C12", &matrix[1][2]);
-  elem->QueryDoubleAttribute("C13", &matrix[1][3]);
-  elem->QueryDoubleAttribute("C14", &matrix[1][4]);
-  elem->QueryDoubleAttribute("C15", &matrix[1][5]);
-
-  int tmpval = 0;
-  elem->QueryIntAttribute("Valid", &tmpval);
-  if (tmpval == 0)
-    dataValid = false;
-  else
-    dataValid = true;
-
-  tmpval = 0;
-  elem->QueryIntAttribute("hO", &tmpval);
-  if (tmpval == 0)
-    hasOrientation = false;
-  else
-    hasOrientation = true;
-
-  tmpval = 0;
-  elem->QueryIntAttribute("hP", &tmpval);
-  if (tmpval == 0)
-    hasPosition = false;
-  else
-    hasPosition = true;
-
-  nd->SetIGTTimeStamp(timestamp);
-  nd->SetPosition(position);
-  nd->SetOrientation(orientation);
-  nd->SetCovErrorMatrix(matrix);
-  nd->SetDataValid(dataValid);
-  nd->SetHasOrientation(hasOrientation);
-  nd->SetHasPosition(hasPosition);
-
-
-  return nd;
-}
+    do
+    {
+      std::vector<NavigationData::Pointer> navDatas(toolCount);
 
-// -- deprecated | begin
-unsigned int mitk::NavigationDataReaderXML::GetFileVersion(std::istream* stream)
-{
-  if (stream==nullptr)
-  {
-    MITK_ERROR << "No input stream set!";
-    mitkThrowException(mitk::IGTIOException)<<"No input stream set!";
-  }
-  if (!stream->good())
-  {
-    MITK_ERROR << "Stream is not good!";
-    mitkThrowException(mitk::IGTIOException)<<"Stream is not good!";
-  }
-  int version = 1;
+      for (decltype(toolCount) i = 0; i < toolCount; ++i)
+      {
+        navData = ReadNavigationData(ndElem);
 
-  auto  dec = new TiXmlDeclaration();
-  *stream >> *dec;
-  if(strcmp(dec->Version(),"") == 0)
-  {
-    MITK_ERROR << "The input stream seems to have XML incompatible format";
-    mitkThrowException(mitk::IGTIOException) << "The input stream seems to have XML incompatible format";
-  }
+        if (navData.IsNull())
+        {
+          if (0 != i)
+            MITK_WARN("mitkNavigationDataReaderXML") << "Different number of NavigationData objects for different tools. Ignoring last ones.";
 
-  m_parentElement = new TiXmlElement("");
-  *stream >> *m_parentElement; //2nd line this is the file version
+          break;
+        }
 
-  std::string tempValue = m_parentElement->Value();
-  if(tempValue != "Version")
-  {
-      if(tempValue == "Data"){
-          m_parentElement->QueryIntAttribute("version",&version);
+        navDatas[i] = navData;
+        ndElem = ndElem->NextSiblingElement();
       }
-  }
-  else
-  {
-    m_parentElement->QueryIntAttribute("Ver",&version);
-  }
 
-  if (version > 0) { return version; }
-  else { return 0; }
-}
+      if (navData.IsNotNull())
+        navDataSet->AddNavigationDatas(navDatas);
 
-unsigned int mitk::NavigationDataReaderXML::GetNumberOfNavigationDatas(std::istream* stream)
-{
-  if (stream == nullptr)
-  {
-    MITK_ERROR << "No input stream set!";
-    mitkThrowException(mitk::IGTException)<<"No input stream set!";
-  }
-  if (!stream->good())
-  {
-    MITK_ERROR << "Stream not good!";
-    mitkThrowException(mitk::IGTException)<<"Stream not good!";
-  }
-
-  //If something has changed in a future version of the XML definition e.g. navigationcount or addional parameters
-  //catch this here with a select case block (see GenerateData() method)
-
-  int numberOfTools = 0;
-
-  std::string tempValue = m_parentElement->Value();
-  if(tempValue == "Version"){
-    *stream >> *m_parentElement;
+    } while (nullptr != ndElem && navData.IsNotNull());
   }
-  m_parentElement->QueryIntAttribute("ToolCount",&numberOfTools);
-
-  if (numberOfTools > 0) { return numberOfTools; }
 
-  return 0;
-}
-
-void mitk::NavigationDataReaderXML::StreamInvalid(std::string message)
-{
-  m_StreamEnd = true;
-  m_ErrorMessage = message;
-  m_StreamValid = false;
-  mitkThrowException(mitk::IGTIOException) << "Invalid stream!";
+  return navDataSet;
 }
-// -- deprecated | end
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
index 8c6dc89b47..2209f661e6 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
@@ -1,106 +1,50 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
 #define MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
 
 #include <MitkIGTIOExports.h>
 
 #include <mitkAbstractFileReader.h>
 #include <mitkNavigationDataSet.h>
 // includes for exceptions
 #include <mitkIGTException.h>
 #include <mitkIGTIOException.h>
 
-class TiXmlElement;
-class TiXmlNode;
-
 namespace mitk {
 
   class MITKIGTIO_EXPORT NavigationDataReaderXML : public AbstractFileReader
   {
   public:
     NavigationDataReaderXML();
     ~NavigationDataReaderXML() override;
 
     using AbstractFileReader::Read;
 
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
     NavigationDataReaderXML(const NavigationDataReaderXML& other);
     mitk::NavigationDataReaderXML* Clone() const override;
 
-    NavigationDataSet::Pointer ReadNavigationDataSet();
-
-    /**
-     * \brief This method reads one line of the XML document and returns the data as a NavigationData object
-     * If there is a new file version another method must be added which reads this data.
-     * @throw mitk::IGTException Throws an exceptions if file is damaged.
-     */
-    mitk::NavigationData::Pointer ReadVersion1();
-    mitk::NavigationData::Pointer ReadNavigationData(TiXmlElement* elem);
-
     std::string m_FileName;
 
-    TiXmlElement* m_parentElement;
-    TiXmlNode* m_currentNode;
-
-    int m_FileVersion; ///< indicates which XML encoding is used
-    int m_NumberOfOutputs; ///< stores the number of outputs known from the XML document
-
-    // -- deprecated | begin
-    //std::istream* m_Stream; ///< stores a pointer to the input stream
-    bool m_StreamEnd; ///< stores if the input stream arrived at end
-    bool m_StreamValid;                       ///< stores if the input stream is valid or not
-    std::string m_ErrorMessage;               ///< stores the error message if the stream is invalid
-
-    /**
-     * \brief Creates a stream out of the filename given by the variable m_FileName.
-     * The stream is then set to m_Stream.
-     *
-     * @throw mitk::IGTIOException Throws an exception if file does not exist
-     * @throw mitk::IGTException Throws an exception if the stream is nullptr
-     */
-    //void CreateStreamFromFilename();
-
-    /**
-     * \brief Returns the file version out of the XML document.
-     * @throw mitk::IGTException Throws an mitk::IGTException an exception if stream is nullptr or not good.
-     * @throw mitk::IGTIOException Throws an mitk::IGTIOException if the stream has an incompatible XML format.
-     */
-    unsigned int GetFileVersion(std::istream* stream);
-
-    /**
-     * \brief Returns the number of tracked tools out of the XML document.
-     * @throw Throws an exception if stream is nullptr.
-     * @throw Throws an exception if the input stream has an XML incompatible format.
-     */
-    unsigned int GetNumberOfNavigationDatas(std::istream* stream);
-
-    /**
-     * @brief This is a helping method which gives an error message and throws an exception with the given message.
-     *        It can be used if a stream is found to be invalid.
-     *
-     * @throw mitk::IGTIOException Always throws an exception.
-     */
-    void StreamInvalid(std::string message);  ///< help method which sets the stream invalid and displays an error
-    // -- deprecated | end
   private:
-    NavigationDataSet::Pointer Read(std::istream* stream);
-    NavigationDataSet::Pointer Read(std::string fileName);
+    NavigationDataSet::Pointer Read(std::istream& stream);
+    NavigationDataSet::Pointer Read(const std::string& fileName);
   };
 
 } // namespace mitk
 
 #endif // MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.cpp b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.cpp
index 8816d1ab38..1256f4f8f0 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.cpp
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.cpp
@@ -1,139 +1,141 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkNavigationDataSetWriterXML.h"
 #include <mitkIGTMimeTypes.h>
 #include <mitkLocaleSwitch.h>
 
 // Third Party
-#include <tinyxml.h>
+#include <tinyxml2.h>
 #include <itksys/SystemTools.hxx>
 #include <fstream>
 #include <iostream>
 
 mitk::NavigationDataSetWriterXML::NavigationDataSetWriterXML() : AbstractFileWriter(NavigationDataSet::GetStaticNameOfClass(),
   mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(),
   "MITK NavigationDataSet Writer (XML)")
 {
   RegisterService();
 }
 
 mitk::NavigationDataSetWriterXML::NavigationDataSetWriterXML(const mitk::NavigationDataSetWriterXML& other) : AbstractFileWriter(other)
 {
 }
 
 mitk::NavigationDataSetWriterXML::~NavigationDataSetWriterXML()
 {
 }
 
 mitk::NavigationDataSetWriterXML* mitk::NavigationDataSetWriterXML::Clone() const
 {
   return new NavigationDataSetWriterXML(*this);
 }
 
 void mitk::NavigationDataSetWriterXML::Write()
 {
   std::ostream* out = GetOutputStream();
   if (out == nullptr)
   {
     out = new std::ofstream( GetOutputLocation().c_str() );
   }
   mitk::NavigationDataSet::ConstPointer data = dynamic_cast<const NavigationDataSet*> (this->GetInput());
 
   mitk::LocaleSwitch localeSwitch("C");
 
   StreamHeader(out, data);
   StreamData(out, data);
   StreamFooter(out);
 
   // Cleanup
   out->flush();
   delete out;
 }
 
 void mitk::NavigationDataSetWriterXML::StreamHeader (std::ostream* stream, mitk::NavigationDataSet::ConstPointer data)
 {
   stream->precision(10);
 
   //TODO store date and GMT time
   //checking if the stream is good
   if (stream->good())
   {
     *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" << std::endl;
     /**m_Stream << "<Version Ver=\"1\" />" << std::endl;*/
     // should be a generic version, meaning a member variable, which has the actual version
     *stream << "    " << "<Data ToolCount=\"" << data->GetNumberOfTools() << "\" version=\"1.0\">" << std::endl;
   }
 }
 
 void mitk::NavigationDataSetWriterXML::StreamData (std::ostream* stream, mitk::NavigationDataSet::ConstPointer data)
 {
   // For each time step in the Dataset
   for (auto it = data->Begin(); it != data->End(); it++)
   {
     for (std::size_t toolIndex = 0; toolIndex < it->size(); toolIndex++)
     {
       mitk::NavigationData::Pointer nd = it->at(toolIndex);
-      auto  elem = new TiXmlElement("ND");
+      tinyxml2::XMLDocument doc;
+      auto *elem = doc.NewElement("ND");
 
-      elem->SetDoubleAttribute("Time", nd->GetIGTTimeStamp());
+      elem->SetAttribute("Time", nd->GetIGTTimeStamp());
       // elem->SetAttribute("SystemTime", sysTimeStr); // tag for system time
-      elem->SetDoubleAttribute("Tool", toolIndex);
-      elem->SetDoubleAttribute("X", nd->GetPosition()[0]);
-      elem->SetDoubleAttribute("Y", nd->GetPosition()[1]);
-      elem->SetDoubleAttribute("Z", nd->GetPosition()[2]);
-
-      elem->SetDoubleAttribute("QX", nd->GetOrientation()[0]);
-      elem->SetDoubleAttribute("QY", nd->GetOrientation()[1]);
-      elem->SetDoubleAttribute("QZ", nd->GetOrientation()[2]);
-      elem->SetDoubleAttribute("QR", nd->GetOrientation()[3]);
-
-      elem->SetDoubleAttribute("C00", nd->GetCovErrorMatrix()[0][0]);
-      elem->SetDoubleAttribute("C01", nd->GetCovErrorMatrix()[0][1]);
-      elem->SetDoubleAttribute("C02", nd->GetCovErrorMatrix()[0][2]);
-      elem->SetDoubleAttribute("C03", nd->GetCovErrorMatrix()[0][3]);
-      elem->SetDoubleAttribute("C04", nd->GetCovErrorMatrix()[0][4]);
-      elem->SetDoubleAttribute("C05", nd->GetCovErrorMatrix()[0][5]);
-      elem->SetDoubleAttribute("C10", nd->GetCovErrorMatrix()[1][0]);
-      elem->SetDoubleAttribute("C11", nd->GetCovErrorMatrix()[1][1]);
-      elem->SetDoubleAttribute("C12", nd->GetCovErrorMatrix()[1][2]);
-      elem->SetDoubleAttribute("C13", nd->GetCovErrorMatrix()[1][3]);
-      elem->SetDoubleAttribute("C14", nd->GetCovErrorMatrix()[1][4]);
-      elem->SetDoubleAttribute("C15", nd->GetCovErrorMatrix()[1][5]);
+      elem->SetAttribute("Tool", static_cast<int>(toolIndex));
+      elem->SetAttribute("X", nd->GetPosition()[0]);
+      elem->SetAttribute("Y", nd->GetPosition()[1]);
+      elem->SetAttribute("Z", nd->GetPosition()[2]);
+
+      elem->SetAttribute("QX", nd->GetOrientation()[0]);
+      elem->SetAttribute("QY", nd->GetOrientation()[1]);
+      elem->SetAttribute("QZ", nd->GetOrientation()[2]);
+      elem->SetAttribute("QR", nd->GetOrientation()[3]);
+
+      elem->SetAttribute("C00", nd->GetCovErrorMatrix()[0][0]);
+      elem->SetAttribute("C01", nd->GetCovErrorMatrix()[0][1]);
+      elem->SetAttribute("C02", nd->GetCovErrorMatrix()[0][2]);
+      elem->SetAttribute("C03", nd->GetCovErrorMatrix()[0][3]);
+      elem->SetAttribute("C04", nd->GetCovErrorMatrix()[0][4]);
+      elem->SetAttribute("C05", nd->GetCovErrorMatrix()[0][5]);
+      elem->SetAttribute("C10", nd->GetCovErrorMatrix()[1][0]);
+      elem->SetAttribute("C11", nd->GetCovErrorMatrix()[1][1]);
+      elem->SetAttribute("C12", nd->GetCovErrorMatrix()[1][2]);
+      elem->SetAttribute("C13", nd->GetCovErrorMatrix()[1][3]);
+      elem->SetAttribute("C14", nd->GetCovErrorMatrix()[1][4]);
+      elem->SetAttribute("C15", nd->GetCovErrorMatrix()[1][5]);
 
       if (nd->IsDataValid())
         elem->SetAttribute("Valid",1);
       else
         elem->SetAttribute("Valid",0);
 
       if (nd->GetHasOrientation())
         elem->SetAttribute("hO",1);
       else
         elem->SetAttribute("hO",0);
 
       if (nd->GetHasPosition())
         elem->SetAttribute("hP",1);
       else
         elem->SetAttribute("hP",0);
 
-      *stream << "        " << *elem << std::endl;
+      tinyxml2::XMLPrinter printer;
+      doc.Print(&printer);
 
-      delete elem;
+      *stream << "        " << printer.CStr() << std::endl;
     }
   }
 }
 
 void mitk::NavigationDataSetWriterXML::StreamFooter (std::ostream* stream)
 {
   *stream << "</Data>" << std::endl;
 }
diff --git a/Modules/LegacyIO/CMakeLists.txt b/Modules/LegacyIO/CMakeLists.txt
index d9debfbd64..dfa9b7c754 100644
--- a/Modules/LegacyIO/CMakeLists.txt
+++ b/Modules/LegacyIO/CMakeLists.txt
@@ -1,8 +1,14 @@
 mitkFunctionCheckCompilerFlags("/wd4996" CMAKE_CXX_FLAGS)
 mitkFunctionCheckCompilerFlags("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
 
 MITK_CREATE_MODULE(
   DEPENDS MitkCore
-  PACKAGE_DEPENDS PRIVATE ITK|ITKIOGDCM+ITKIORAW tinyxml
+  PACKAGE_DEPENDS PRIVATE ITK|ITKIOGDCM+ITKIORAW tinyxml2|tinyxml2
   DEPRECATED_SINCE 2014.10
 )
+
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
diff --git a/Modules/LegacyIO/mitkPointSetReader.cpp b/Modules/LegacyIO/mitkPointSetReader.cpp
index 7222c061e5..f33d2cc3f8 100644
--- a/Modules/LegacyIO/mitkPointSetReader.cpp
+++ b/Modules/LegacyIO/mitkPointSetReader.cpp
@@ -1,195 +1,195 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPointSetReader.h"
 #include <fstream>
 #include <iostream>
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
 
 mitk::PointSetReader::PointSetReader()
 {
   m_Success = false;
 }
 
 mitk::PointSetReader::~PointSetReader()
 {
 }
 
 void mitk::PointSetReader::GenerateData()
 {
   // Switch the current locale to "C"
   LocaleSwitch localeSwitch("C");
 
   m_Success = false;
   if (m_FileName == "")
   {
     itkWarningMacro(<< "Sorry, filename has not been set!");
     return;
   }
   if (!this->CanReadFile(m_FileName.c_str()))
   {
     itkWarningMacro(<< "Sorry, can't read file " << m_FileName << "!");
     return;
   }
 
   try
   {
-    TiXmlDocument doc(m_FileName.c_str());
-    bool loadOkay = doc.LoadFile();
-    if (loadOkay)
+    tinyxml2::XMLDocument doc;
+    if (tinyxml2::XML_SUCCESS == doc.LoadFile(m_FileName.c_str()))
     {
-      TiXmlHandle docHandle(&doc);
+      tinyxml2::XMLHandle docHandle(&doc);
       unsigned int pointSetCounter(0);
-      for (TiXmlElement *currentPointSetElement =
+      for (auto *currentPointSetElement =
              docHandle.FirstChildElement("point_set_file").FirstChildElement("point_set").ToElement();
            currentPointSetElement != nullptr;
            currentPointSetElement = currentPointSetElement->NextSiblingElement())
       {
         mitk::PointSet::Pointer newPointSet = mitk::PointSet::New();
         if (currentPointSetElement->FirstChildElement("time_series") != nullptr)
         {
-          for (TiXmlElement *currentTimeSeries = currentPointSetElement->FirstChildElement("time_series")->ToElement();
+          for (auto *currentTimeSeries = currentPointSetElement->FirstChildElement("time_series");
                currentTimeSeries != nullptr;
                currentTimeSeries = currentTimeSeries->NextSiblingElement())
           {
             unsigned int currentTimeStep(0);
-            TiXmlElement *currentTimeSeriesID = currentTimeSeries->FirstChildElement("time_series_id");
+            auto *currentTimeSeriesID = currentTimeSeries->FirstChildElement("time_series_id");
 
             currentTimeStep = atoi(currentTimeSeriesID->GetText());
 
             newPointSet = this->ReadPoint(newPointSet, currentTimeSeries, currentTimeStep);
           }
         }
         else
         {
           newPointSet = this->ReadPoint(newPointSet, currentPointSetElement, 0);
         }
         this->SetNthOutput(pointSetCounter, newPointSet);
         pointSetCounter++;
       }
     }
     else
     {
       MITK_WARN << "XML parser error!";
     }
   }
   catch (...)
   {
     MITK_ERROR << "Cannot read point set.";
     m_Success = false;
   }
   m_Success = true;
 }
 
 mitk::PointSet::Pointer mitk::PointSetReader::ReadPoint(mitk::PointSet::Pointer newPointSet,
-                                                        TiXmlElement *currentTimeSeries,
+                                                        const tinyxml2::XMLElement *currentTimeSeries,
                                                         unsigned int currentTimeStep)
 {
   if (currentTimeSeries->FirstChildElement("point") != nullptr)
   {
-    for (TiXmlElement *currentPoint = currentTimeSeries->FirstChildElement("point")->ToElement();
+    for (auto *currentPoint = currentTimeSeries->FirstChildElement("point");
          currentPoint != nullptr;
          currentPoint = currentPoint->NextSiblingElement())
     {
       unsigned int id(0);
       mitk::PointSpecificationType spec((mitk::PointSpecificationType)0);
       double x(0.0);
       double y(0.0);
       double z(0.0);
 
       id = atoi(currentPoint->FirstChildElement("id")->GetText());
       if (currentPoint->FirstChildElement("specification") != nullptr)
       {
         spec = (mitk::PointSpecificationType)atoi(currentPoint->FirstChildElement("specification")->GetText());
       }
       x = atof(currentPoint->FirstChildElement("x")->GetText());
       y = atof(currentPoint->FirstChildElement("y")->GetText());
       z = atof(currentPoint->FirstChildElement("z")->GetText());
 
       mitk::Point3D point;
       mitk::FillVector3D(point, x, y, z);
       newPointSet->SetPoint(id, point, spec, currentTimeStep);
     }
   }
   else
   {
     if (currentTimeStep != newPointSet->GetTimeSteps() + 1)
     {
       newPointSet->Expand(currentTimeStep + 1); // expand time step series with empty time step
     }
   }
   return newPointSet;
 }
 
 void mitk::PointSetReader::GenerateOutputInformation()
 {
 }
 
 int mitk::PointSetReader::CanReadFile(const char *name)
 {
   std::ifstream in(name);
   bool isGood = in.good();
   in.close();
   return isGood;
 }
 
 bool mitk::PointSetReader::CanReadFile(const std::string filename,
                                        const std::string filePrefix,
                                        const std::string filePattern)
 {
   // First check the extension
   if (filename == "")
   {
     // MITK_INFO<<"No filename specified."<<std::endl;
     return false;
   }
 
   // check if image is serie
   if (filePattern != "" && filePrefix != "")
     return false;
 
   bool extensionFound = false;
   std::string::size_type MPSPos = filename.rfind(".mps");
   if ((MPSPos != std::string::npos) && (MPSPos == filename.length() - 4))
   {
     extensionFound = true;
   }
 
   MPSPos = filename.rfind(".MPS");
   if ((MPSPos != std::string::npos) && (MPSPos == filename.length() - 4))
   {
     extensionFound = true;
   }
 
   if (!extensionFound)
   {
     // MITK_INFO<<"The filename extension is not recognized."<<std::endl;
     return false;
   }
 
   return true;
 }
 
 void mitk::PointSetReader::ResizeOutputs(const unsigned int &num)
 {
   unsigned int prevNum = this->GetNumberOfOutputs();
   this->SetNumberOfIndexedOutputs(num);
   for (unsigned int i = prevNum; i < num; ++i)
   {
     this->SetNthOutput(i, this->MakeOutput(i).GetPointer());
   }
 }
 
 bool mitk::PointSetReader::GetSuccess() const
 {
   return m_Success;
 }
diff --git a/Modules/LegacyIO/mitkPointSetReader.h b/Modules/LegacyIO/mitkPointSetReader.h
index eb4cc27c51..9ea21cd980 100644
--- a/Modules/LegacyIO/mitkPointSetReader.h
+++ b/Modules/LegacyIO/mitkPointSetReader.h
@@ -1,141 +1,145 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef _MITK_POINT_SET_READER__H_
 #define _MITK_POINT_SET_READER__H_
 
 #include <MitkLegacyIOExports.h>
 
 #include <mitkFileReader.h>
 #include <mitkPointSetSource.h>
 #include <stack>
 #include <string>
-#include <tinyxml.h>
 #include <vtkXMLParser.h>
 
+namespace tinyxml2
+{
+  class XMLElement;
+}
+
 namespace mitk
 {
   /**
    * @brief reads xml representations of mitk::PointSets from a file
    *
    * Reader for xml files containing one or multiple xml represenations of
    * mitk::PointSets. If multiple mitk::PointSets are stored in one file,
    * these are assigned to multiple outputs of the filter. The number of point
    * sets which have be read can be retrieven by a call to GetNumberOfOutputs()
    * after the pipeline update().
    * The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D
    * Pointsets.
    * @note loading point sets from multiple files according to a given file pattern
    * is not yet supported!
    *
    * @ingroup MitkLegacyIOModule
    *
    * @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
   */
   class MITKLEGACYIO_EXPORT PointSetReader : public PointSetSource, public FileReader
   {
   public:
     mitkClassMacro(PointSetReader, FileReader);
 
     itkFactorylessNewMacro(Self);
 
     itkCloneMacro(Self);
 
       /**
        * @brief Sets the filename of the file to be read
        * @param _arg the filename of the point set xml-file
        */
       itkSetStringMacro(FileName);
 
     /**
      * @brief Returns the filename of the point set xml-file.
      * @returns the filename of the point set xml-file.
      */
     itkGetStringMacro(FileName);
 
     /**
      * @warning multiple load not (yet) supported
      */
     itkSetStringMacro(FilePrefix);
 
     /**
      * @warning multiple load not (yet) supported
      */
     itkGetStringMacro(FilePrefix);
 
     /**
      * @warning multiple load not (yet) supported
      */
     itkSetStringMacro(FilePattern);
 
     /**
      * @warning multiple load not (yet) supported
      */
     itkGetStringMacro(FilePattern);
 
     static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
 
     /**
      * @returns whether the last read attempt was successful or not.
      */
     bool GetSuccess() const;
 
   protected:
     /**
      * Constructor
      */
     PointSetReader();
 
     /**
      * Virtual destructor
      */
     ~PointSetReader() override;
 
     /**
      * Actually reads the point sets from the given file
      */
     void GenerateData() override;
 
     virtual mitk::PointSet::Pointer ReadPoint(mitk::PointSet::Pointer newPointSet,
-                                              TiXmlElement *currentTimeSeries,
+                                              const tinyxml2::XMLElement *currentTimeSeries,
                                               unsigned int currentTimeStep);
 
     /**
      * Does nothing in the current implementation
      */
     void GenerateOutputInformation() override;
 
     /**
      * Resizes the output-objects according to the given number.
      * @param num the new number of output objects.
      */
     virtual void ResizeOutputs(const unsigned int &num);
 
     /**
      * Checks if the given file has appropriate
      * read access.
      * @returns true if the file exists and may be read
      *          or false otherwise.
      */
     virtual int CanReadFile(const char *name);
 
     std::string m_FileName;
 
     std::string m_FilePrefix;
 
     std::string m_FilePattern;
 
     bool m_Success;
   };
 }
 
 #endif
diff --git a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
index b3db0deccc..d26f60e0d1 100644
--- a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
+++ b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
@@ -1,55 +1,55 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkScalarListLookupTablePropertySerializer_h
 #define mitkScalarListLookupTablePropertySerializer_h
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkBaseProperty.h"
 
 #include "MitkModelFitExports.h"
 
 namespace mitk
 {
     /**
      *  @brief  Serializer for the ScalarListLookupTableProperty so it can be written and read from
      *          file.
      */
     class ScalarListLookupTablePropertySerializer : public BasePropertySerializer
     {
     public:
         mitkClassMacro(ScalarListLookupTablePropertySerializer, BasePropertySerializer);
         itkNewMacro(Self);
 
-        TiXmlElement* Serialize() override;
-        BaseProperty::Pointer Deserialize(TiXmlElement* element) override;
+        tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override;
+        BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement* element) override;
 
     protected:
         ScalarListLookupTablePropertySerializer() {}
         ~ScalarListLookupTablePropertySerializer() override {}
     };
 
   namespace PropertyPersistenceSerialization
   {
     /** Serialization of a ScalarListLookupTableProperty into a XML string.*/
     MITKMODELFIT_EXPORT ::std::string serializeScalarListLookupTablePropertyToXML(const mitk::BaseProperty *prop);
   }
 
   namespace PropertyPersistenceDeserialization
   {
     /**Deserialize a passed XML string into a ScalarListLookupTableProperty.*/
     MITKMODELFIT_EXPORT mitk::BaseProperty::Pointer deserializeXMLToScalarListLookupTableProperty(const std::string &value);
   }
 }
 
 #endif // mitkScalarListLookupTablePropertySerializer_h
diff --git a/Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp b/Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp
index 751a407cce..e54b48d683 100644
--- a/Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp
+++ b/Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp
@@ -1,127 +1,129 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkScalarListLookupTableProperty.h"
 #include "mitkScalarListLookupTablePropertySerializer.h"
+#include <tinyxml2.h>
 
-
-TiXmlElement* mitk::ScalarListLookupTablePropertySerializer::Serialize()
+tinyxml2::XMLElement* mitk::ScalarListLookupTablePropertySerializer::Serialize(tinyxml2::XMLDocument& doc)
 {
-	const ScalarListLookupTableProperty* prop =
-		dynamic_cast<const ScalarListLookupTableProperty*>(m_Property.GetPointer());
-
-	if (prop == nullptr)
-	{
-		MITK_ERROR << "Serialization: Property is NULL";
-		return nullptr;
-	}
-
-	ScalarListLookupTable lut = prop->GetValue();
-	const ScalarListLookupTable::LookupTableType& map = lut.GetLookupTable();
-
-	TiXmlElement* mapElement = new TiXmlElement("ScalarListLookupTable");
-
-	for (ScalarListLookupTable::LookupTableType::const_iterator mapIter = map.begin();
-		 mapIter != map.end(); ++mapIter)
-	{
-		const ScalarListLookupTable::ValueType& list = mapIter->second;
-		TiXmlElement* listElement = new TiXmlElement("List");
-		listElement->SetAttribute("name", mapIter->first);
-
-		for (ScalarListLookupTable::ValueType::const_iterator listIter =  list.begin();
-			 listIter != list.end(); ++listIter)
-		{
-			TiXmlElement* valueElement = new TiXmlElement("Element");
-			valueElement->SetDoubleAttribute("value", *listIter);
-			listElement->LinkEndChild(valueElement);
-		}
-
-		mapElement->LinkEndChild(listElement);
-	}
-
-	return mapElement;
+  const ScalarListLookupTableProperty* prop =
+    dynamic_cast<const ScalarListLookupTableProperty*>(m_Property.GetPointer());
+
+  if (prop == nullptr)
+  {
+    MITK_ERROR << "Serialization: Property is NULL";
+    return nullptr;
+  }
+
+  ScalarListLookupTable lut = prop->GetValue();
+  const ScalarListLookupTable::LookupTableType& map = lut.GetLookupTable();
+
+  auto* mapElement = doc.NewElement("ScalarListLookupTable");
+
+  for (ScalarListLookupTable::LookupTableType::const_iterator mapIter = map.begin();
+     mapIter != map.end(); ++mapIter)
+  {
+    const ScalarListLookupTable::ValueType& list = mapIter->second;
+    auto* listElement = doc.NewElement("List");
+    listElement->SetAttribute("name", mapIter->first.c_str());
+
+    for (ScalarListLookupTable::ValueType::const_iterator listIter =  list.begin();
+       listIter != list.end(); ++listIter)
+    {
+      auto* valueElement = doc.NewElement("Element");
+      valueElement->SetAttribute("value", *listIter);
+      listElement->InsertEndChild(valueElement);
+    }
+
+    mapElement->InsertEndChild(listElement);
+  }
+
+  return mapElement;
 }
 
 mitk::BaseProperty::Pointer
-mitk::ScalarListLookupTablePropertySerializer::Deserialize(TiXmlElement* element)
+mitk::ScalarListLookupTablePropertySerializer::Deserialize(const tinyxml2::XMLElement* element)
 {
-	if (!element)
-	{
-		MITK_ERROR << "Deserialization: Element is NULL";
-		return nullptr;
-	}
-
-	ScalarListLookupTable lut;
-
-	for (TiXmlElement* listElement = element->FirstChildElement("List");
-		 listElement != nullptr; listElement = listElement->NextSiblingElement("List"))
-	{
-		std::string name;
-
-		if (listElement->Attribute("name") != nullptr)
-		{
-			name = listElement->Attribute("name");
-		}
-		else
-		{
-			MITK_ERROR << "Deserialization: No element with attribute 'name' found";
-			return nullptr;
-		}
-
-		ScalarListLookupTable::ValueType list;
-
-		for (TiXmlElement* valueElement = listElement->FirstChildElement("Element");
-			 valueElement != nullptr;
-			 valueElement = valueElement->NextSiblingElement("Element"))
-		{
-			double value;
-
-			if (valueElement->QueryDoubleAttribute("value", &value) == TIXML_WRONG_TYPE)
-			{
-				MITK_ERROR << "Deserialization: No element with attribute 'value' found";
-				return nullptr;
-			}
-
-			list.push_back(value);
-		}
-
-		lut.SetTableValue(name, list);
-	}
-
-	return ScalarListLookupTableProperty::New(lut).GetPointer();
+  if (!element)
+  {
+    MITK_ERROR << "Deserialization: Element is NULL";
+    return nullptr;
+  }
+
+  ScalarListLookupTable lut;
+
+  for (auto* listElement = element->FirstChildElement("List");
+     listElement != nullptr; listElement = listElement->NextSiblingElement("List"))
+  {
+    std::string name;
+
+    if (listElement->Attribute("name") != nullptr)
+    {
+      name = listElement->Attribute("name");
+    }
+    else
+    {
+      MITK_ERROR << "Deserialization: No element with attribute 'name' found";
+      return nullptr;
+    }
+
+    ScalarListLookupTable::ValueType list;
+
+    for (auto* valueElement = listElement->FirstChildElement("Element");
+       valueElement != nullptr;
+       valueElement = valueElement->NextSiblingElement("Element"))
+    {
+      double value;
+
+      if (valueElement->QueryDoubleAttribute("value", &value) != tinyxml2::XML_SUCCESS)
+      {
+        MITK_ERROR << "Deserialization: No element with attribute 'value' found";
+        return nullptr;
+      }
+
+      list.push_back(value);
+    }
+
+    lut.SetTableValue(name, list);
+  }
+
+  return ScalarListLookupTableProperty::New(lut).GetPointer();
 }
 
 MITK_REGISTER_SERIALIZER(ScalarListLookupTablePropertySerializer);
 
 ::std::string mitk::PropertyPersistenceSerialization::serializeScalarListLookupTablePropertyToXML(
   const mitk::BaseProperty *prop)
 {
   mitk::ScalarListLookupTablePropertySerializer::Pointer lutSerializer = mitk::ScalarListLookupTablePropertySerializer::New();
 
   lutSerializer->SetProperty(prop);
-  auto xmlLut = lutSerializer->Serialize();
 
-  TiXmlPrinter printer;
-  xmlLut->Accept(&printer);
-  printer.SetStreamPrinting();
-  return printer.Str();
+  tinyxml2::XMLDocument doc;
+  lutSerializer->Serialize(doc);
+
+  tinyxml2::XMLPrinter printer;
+  doc.Print(&printer);
+
+  return printer.CStr();
 }
 
 mitk::BaseProperty::Pointer mitk::PropertyPersistenceDeserialization::deserializeXMLToScalarListLookupTableProperty(
   const std::string &value)
 {
   mitk::ScalarListLookupTablePropertySerializer::Pointer lutSerializer = mitk::ScalarListLookupTablePropertySerializer::New();
 
-  TiXmlDocument doc;
+  tinyxml2::XMLDocument doc;
   doc.Parse(value.c_str());
   return lutSerializer->Deserialize(doc.RootElement());
 }
diff --git a/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.cpp b/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.cpp
index 0e041818c9..981ea9cf30 100644
--- a/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.cpp
+++ b/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.cpp
@@ -1,652 +1,648 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef __mitkLabelSetImageWriter__cpp
 #define __mitkLabelSetImageWriter__cpp
 
 #include "mitkLabelSetImageIO.h"
 #include "mitkBasePropertySerializer.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkImageAccessByItk.h"
 #include "mitkLabelSetIOHelper.h"
 #include "mitkLabelSetImageConverter.h"
 #include <mitkLocaleSwitch.h>
 #include <mitkArbitraryTimeGeometry.h>
 #include <mitkIPropertyPersistence.h>
 #include <mitkCoreServices.h>
 #include <mitkItkImageIO.h>
 #include <mitkUIDManipulator.h>
 
 // itk
 #include "itkImageFileReader.h"
 #include "itkImageFileWriter.h"
 #include "itkMetaDataDictionary.h"
 #include "itkMetaDataObject.h"
 #include "itkNrrdImageIO.h"
 
+#include <tinyxml2.h>
+
 namespace mitk
 {
 
   const char* const PROPERTY_NAME_TIMEGEOMETRY_TYPE = "org.mitk.timegeometry.type";
   const char* const PROPERTY_NAME_TIMEGEOMETRY_TIMEPOINTS = "org.mitk.timegeometry.timepoints";
   const char* const PROPERTY_KEY_TIMEGEOMETRY_TYPE = "org_mitk_timegeometry_type";
   const char* const PROPERTY_KEY_TIMEGEOMETRY_TIMEPOINTS = "org_mitk_timegeometry_timepoints";
   const char* const PROPERTY_KEY_UID = "org_mitk_uid";
 
   LabelSetImageIO::LabelSetImageIO()
     : AbstractFileIO(LabelSetImage::GetStaticNameOfClass(), IOMimeTypes::NRRD_MIMETYPE(), "MITK Multilabel Image")
   {
     AbstractFileWriter::SetRanking(10);
     AbstractFileReader::SetRanking(10);
     this->RegisterService();
   }
 
   IFileIO::ConfidenceLevel LabelSetImageIO::GetWriterConfidenceLevel() const
   {
     if (AbstractFileIO::GetWriterConfidenceLevel() == Unsupported)
       return Unsupported;
     const auto *input = static_cast<const LabelSetImage *>(this->GetInput());
     if (input)
       return Supported;
     else
       return Unsupported;
   }
 
   void LabelSetImageIO::Write()
   {
     ValidateOutputLocation();
 
     auto input = dynamic_cast<const LabelSetImage *>(this->GetInput());
 
     mitk::LocaleSwitch localeSwitch("C");
 
     mitk::Image::Pointer inputVector = mitk::ConvertLabelSetImageToImage(input);
 
     // image write
     if (inputVector.IsNull())
     {
       mitkThrow() << "Cannot write non-image data";
     }
 
     itk::NrrdImageIO::Pointer nrrdImageIo = itk::NrrdImageIO::New();
 
     // Clone the image geometry, because we might have to change it
     // for writing purposes
     BaseGeometry::Pointer geometry = inputVector->GetGeometry()->Clone();
 
     // Check if geometry information will be lost
     if (inputVector->GetDimension() == 2 && !geometry->Is2DConvertable())
     {
       MITK_WARN << "Saving a 2D image with 3D geometry information. Geometry information will be lost! You might "
                    "consider using Convert2Dto3DImageFilter before saving.";
 
       // set matrix to identity
       mitk::AffineTransform3D::Pointer affTrans = mitk::AffineTransform3D::New();
       affTrans->SetIdentity();
       mitk::Vector3D spacing = geometry->GetSpacing();
       mitk::Point3D origin = geometry->GetOrigin();
       geometry->SetIndexToWorldTransform(affTrans);
       geometry->SetSpacing(spacing);
       geometry->SetOrigin(origin);
     }
 
     LocalFile localFile(this);
     const std::string path = localFile.GetFileName();
 
     MITK_INFO << "Writing image: " << path << std::endl;
 
     try
     {
       // Implementation of writer using itkImageIO directly. This skips the use
       // of templated itkImageFileWriter, which saves the multiplexing on MITK side.
 
       const unsigned int dimension = inputVector->GetDimension();
       const unsigned int *const dimensions = inputVector->GetDimensions();
       const mitk::PixelType pixelType = inputVector->GetPixelType();
       const mitk::Vector3D mitkSpacing = geometry->GetSpacing();
       const mitk::Point3D mitkOrigin = geometry->GetOrigin();
 
       // Due to templating in itk, we are forced to save a 4D spacing and 4D Origin,
       // though they are not supported in MITK
       itk::Vector<double, 4u> spacing4D;
       spacing4D[0] = mitkSpacing[0];
       spacing4D[1] = mitkSpacing[1];
       spacing4D[2] = mitkSpacing[2];
       spacing4D[3] = 1; // There is no support for a 4D spacing. However, we should have a valid value here
 
       itk::Vector<double, 4u> origin4D;
       origin4D[0] = mitkOrigin[0];
       origin4D[1] = mitkOrigin[1];
       origin4D[2] = mitkOrigin[2];
       origin4D[3] = 0; // There is no support for a 4D origin. However, we should have a valid value here
 
       // Set the necessary information for imageIO
       nrrdImageIo->SetNumberOfDimensions(dimension);
       nrrdImageIo->SetPixelType(pixelType.GetPixelType());
       nrrdImageIo->SetComponentType(pixelType.GetComponentType() < PixelComponentUserType ?
                                       static_cast<itk::ImageIOBase::IOComponentType>(pixelType.GetComponentType()) :
                                       itk::ImageIOBase::UNKNOWNCOMPONENTTYPE);
       nrrdImageIo->SetNumberOfComponents(pixelType.GetNumberOfComponents());
 
       itk::ImageIORegion ioRegion(dimension);
 
       for (unsigned int i = 0; i < dimension; i++)
       {
         nrrdImageIo->SetDimensions(i, dimensions[i]);
         nrrdImageIo->SetSpacing(i, spacing4D[i]);
         nrrdImageIo->SetOrigin(i, origin4D[i]);
 
         mitk::Vector3D mitkDirection;
         mitkDirection.SetVnlVector(geometry->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(i));
         itk::Vector<double, 4u> direction4D;
         direction4D[0] = mitkDirection[0];
         direction4D[1] = mitkDirection[1];
         direction4D[2] = mitkDirection[2];
 
         // MITK only supports a 3x3 direction matrix. Due to templating in itk, however, we must
         // save a 4x4 matrix for 4D images. in this case, add an homogneous component to the matrix.
         if (i == 3)
         {
           direction4D[3] = 1; // homogenous component
         }
         else
         {
           direction4D[3] = 0;
         }
         vnl_vector<double> axisDirection(dimension);
         for (unsigned int j = 0; j < dimension; j++)
         {
           axisDirection[j] = direction4D[j] / spacing4D[i];
         }
         nrrdImageIo->SetDirection(i, axisDirection);
 
         ioRegion.SetSize(i, inputVector->GetLargestPossibleRegion().GetSize(i));
         ioRegion.SetIndex(i, inputVector->GetLargestPossibleRegion().GetIndex(i));
       }
 
       // use compression if available
       nrrdImageIo->UseCompressionOn();
 
       nrrdImageIo->SetIORegion(ioRegion);
       nrrdImageIo->SetFileName(path);
 
       // label set specific meta data
       char keybuffer[512];
       char valbuffer[512];
 
       sprintf(keybuffer, "modality");
       sprintf(valbuffer, "org.mitk.image.multilabel");
       itk::EncapsulateMetaData<std::string>(
         nrrdImageIo->GetMetaDataDictionary(), std::string(keybuffer), std::string(valbuffer));
 
       sprintf(keybuffer, "layers");
       sprintf(valbuffer, "%1d", input->GetNumberOfLayers());
       itk::EncapsulateMetaData<std::string>(
         nrrdImageIo->GetMetaDataDictionary(), std::string(keybuffer), std::string(valbuffer));
 
       for (unsigned int layerIdx = 0; layerIdx < input->GetNumberOfLayers(); layerIdx++)
       {
         sprintf(keybuffer, "layer_%03u", layerIdx);                    // layer idx
         sprintf(valbuffer, "%1u", input->GetNumberOfLabels(layerIdx)); // number of labels for the layer
         itk::EncapsulateMetaData<std::string>(
           nrrdImageIo->GetMetaDataDictionary(), std::string(keybuffer), std::string(valbuffer));
 
         auto iter = input->GetLabelSet(layerIdx)->IteratorConstBegin();
         unsigned int count(0);
         while (iter != input->GetLabelSet(layerIdx)->IteratorConstEnd())
         {
-          std::unique_ptr<TiXmlDocument> document;
-          document.reset(new TiXmlDocument());
-
-          auto *decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc....
-          document->LinkEndChild(decl);
-          TiXmlElement *labelElem = mitk::LabelSetIOHelper::GetLabelAsTiXmlElement(iter->second);
-          document->LinkEndChild(labelElem);
-          TiXmlPrinter printer;
-          printer.SetIndent("");
-          printer.SetLineBreak("");
-
-          document->Accept(&printer);
+          tinyxml2::XMLDocument document;
+          document.InsertEndChild(document.NewDeclaration());
+          auto *labelElem = mitk::LabelSetIOHelper::GetLabelAsXMLElement(document, iter->second);
+          document.InsertEndChild(labelElem);
+          tinyxml2::XMLPrinter printer;
+          document.Print(&printer);
 
           sprintf(keybuffer, "org.mitk.label_%03u_%05u", layerIdx, count);
           itk::EncapsulateMetaData<std::string>(
-            nrrdImageIo->GetMetaDataDictionary(), std::string(keybuffer), printer.Str());
+            nrrdImageIo->GetMetaDataDictionary(), std::string(keybuffer), printer.CStr());
           ++iter;
           ++count;
         }
       }
       // end label set specific meta data
 
       // Handle time geometry
       const auto* arbitraryTG = dynamic_cast<const ArbitraryTimeGeometry*>(input->GetTimeGeometry());
       if (arbitraryTG)
       {
         itk::EncapsulateMetaData<std::string>(nrrdImageIo->GetMetaDataDictionary(),
           PROPERTY_KEY_TIMEGEOMETRY_TYPE,
           ArbitraryTimeGeometry::GetStaticNameOfClass());
 
 
         auto metaTimePoints = ConvertTimePointListToMetaDataObject(arbitraryTG);
         nrrdImageIo->GetMetaDataDictionary().Set(PROPERTY_KEY_TIMEGEOMETRY_TIMEPOINTS, metaTimePoints);
       }
 
       // Handle properties
       mitk::PropertyList::Pointer imagePropertyList = input->GetPropertyList();
       for (const auto& property : *imagePropertyList->GetMap())
       {
         mitk::CoreServicePointer<IPropertyPersistence> propPersistenceService(mitk::CoreServices::GetPropertyPersistence());
         IPropertyPersistence::InfoResultType infoList = propPersistenceService->GetInfo(property.first, GetMimeType()->GetName(), true);
 
         if (infoList.empty())
         {
           continue;
         }
 
         std::string value = infoList.front()->GetSerializationFunction()(property.second);
 
         if (value == mitk::BaseProperty::VALUE_CANNOT_BE_CONVERTED_TO_STRING)
         {
           continue;
         }
 
         std::string key = infoList.front()->GetKey();
 
         itk::EncapsulateMetaData<std::string>(nrrdImageIo->GetMetaDataDictionary(), key, value);
       }
 
       // Handle UID
       itk::EncapsulateMetaData<std::string>(nrrdImageIo->GetMetaDataDictionary(), PROPERTY_KEY_UID, input->GetUID());
 
       ImageReadAccessor imageAccess(inputVector);
       nrrdImageIo->Write(imageAccess.GetData());
     }
     catch (const std::exception &e)
     {
       mitkThrow() << e.what();
     }
     // end image write
   }
 
   IFileIO::ConfidenceLevel LabelSetImageIO::GetReaderConfidenceLevel() const
   {
     if (AbstractFileIO::GetReaderConfidenceLevel() == Unsupported)
       return Unsupported;
     const std::string fileName = this->GetLocalFileName();
     itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New();
     io->SetFileName(fileName);
     io->ReadImageInformation();
 
     itk::MetaDataDictionary imgMetaDataDictionary = io->GetMetaDataDictionary();
     std::string value("");
     itk::ExposeMetaData<std::string>(imgMetaDataDictionary, "modality", value);
     if (value.compare("org.mitk.image.multilabel") == 0)
     {
       return Supported;
     }
     else
       return Unsupported;
   }
 
   std::vector<BaseData::Pointer> LabelSetImageIO::DoRead()
   {
     mitk::LocaleSwitch localeSwitch("C");
 
     // begin regular image loading, adapted from mitkItkImageIO
     itk::NrrdImageIO::Pointer nrrdImageIO = itk::NrrdImageIO::New();
     Image::Pointer image = Image::New();
 
     const unsigned int MINDIM = 2;
     const unsigned int MAXDIM = 4;
 
     const std::string path = this->GetLocalFileName();
 
     MITK_INFO << "loading " << path << " via itk::ImageIOFactory... " << std::endl;
 
     // Check to see if we can read the file given the name or prefix
     if (path.empty())
     {
       mitkThrow() << "Empty filename in mitk::ItkImageIO ";
     }
 
     // Got to allocate space for the image. Determine the characteristics of
     // the image.
     nrrdImageIO->SetFileName(path);
     nrrdImageIO->ReadImageInformation();
 
     unsigned int ndim = nrrdImageIO->GetNumberOfDimensions();
     if (ndim < MINDIM || ndim > MAXDIM)
     {
       MITK_WARN << "Sorry, only dimensions 2, 3 and 4 are supported. The given file has " << ndim
                 << " dimensions! Reading as 4D.";
       ndim = MAXDIM;
     }
 
     itk::ImageIORegion ioRegion(ndim);
     itk::ImageIORegion::SizeType ioSize = ioRegion.GetSize();
     itk::ImageIORegion::IndexType ioStart = ioRegion.GetIndex();
 
     unsigned int dimensions[MAXDIM];
     dimensions[0] = 0;
     dimensions[1] = 0;
     dimensions[2] = 0;
     dimensions[3] = 0;
 
     ScalarType spacing[MAXDIM];
     spacing[0] = 1.0f;
     spacing[1] = 1.0f;
     spacing[2] = 1.0f;
     spacing[3] = 1.0f;
 
     Point3D origin;
     origin.Fill(0);
 
     unsigned int i;
     for (i = 0; i < ndim; ++i)
     {
       ioStart[i] = 0;
       ioSize[i] = nrrdImageIO->GetDimensions(i);
       if (i < MAXDIM)
       {
         dimensions[i] = nrrdImageIO->GetDimensions(i);
         spacing[i] = nrrdImageIO->GetSpacing(i);
         if (spacing[i] <= 0)
           spacing[i] = 1.0f;
       }
       if (i < 3)
       {
         origin[i] = nrrdImageIO->GetOrigin(i);
       }
     }
 
     ioRegion.SetSize(ioSize);
     ioRegion.SetIndex(ioStart);
 
     MITK_INFO << "ioRegion: " << ioRegion << std::endl;
     nrrdImageIO->SetIORegion(ioRegion);
     void *buffer = new unsigned char[nrrdImageIO->GetImageSizeInBytes()];
     nrrdImageIO->Read(buffer);
 
     image->Initialize(MakePixelType(nrrdImageIO), ndim, dimensions);
     image->SetImportChannel(buffer, 0, Image::ManageMemory);
 
     // access direction of itk::Image and include spacing
     mitk::Matrix3D matrix;
     matrix.SetIdentity();
     unsigned int j, itkDimMax3 = (ndim >= 3 ? 3 : ndim);
     for (i = 0; i < itkDimMax3; ++i)
       for (j = 0; j < itkDimMax3; ++j)
         matrix[i][j] = nrrdImageIO->GetDirection(j)[i];
 
     // re-initialize PlaneGeometry with origin and direction
     PlaneGeometry *planeGeometry = image->GetSlicedGeometry(0)->GetPlaneGeometry(0);
     planeGeometry->SetOrigin(origin);
     planeGeometry->GetIndexToWorldTransform()->SetMatrix(matrix);
 
     // re-initialize SlicedGeometry3D
     SlicedGeometry3D *slicedGeometry = image->GetSlicedGeometry(0);
     slicedGeometry->InitializeEvenlySpaced(planeGeometry, image->GetDimension(2));
     slicedGeometry->SetSpacing(spacing);
 
     MITK_INFO << slicedGeometry->GetCornerPoint(false, false, false);
     MITK_INFO << slicedGeometry->GetCornerPoint(true, true, true);
 
     // re-initialize TimeGeometry
     const itk::MetaDataDictionary& dictionary = nrrdImageIO->GetMetaDataDictionary();
     TimeGeometry::Pointer timeGeometry;
 
     if (dictionary.HasKey(PROPERTY_NAME_TIMEGEOMETRY_TYPE) || dictionary.HasKey(PROPERTY_KEY_TIMEGEOMETRY_TYPE))
     { // also check for the name because of backwards compatibility. Past code version stored with the name and not with
       // the key
       itk::MetaDataObject<std::string>::ConstPointer timeGeometryTypeData;
       if (dictionary.HasKey(PROPERTY_NAME_TIMEGEOMETRY_TYPE))
       {
         timeGeometryTypeData =
           dynamic_cast<const itk::MetaDataObject<std::string>*>(dictionary.Get(PROPERTY_NAME_TIMEGEOMETRY_TYPE));
       }
       else
       {
         timeGeometryTypeData =
           dynamic_cast<const itk::MetaDataObject<std::string>*>(dictionary.Get(PROPERTY_KEY_TIMEGEOMETRY_TYPE));
       }
 
       if (timeGeometryTypeData->GetMetaDataObjectValue() == ArbitraryTimeGeometry::GetStaticNameOfClass())
       {
         MITK_INFO << "used time geometry: " << ArbitraryTimeGeometry::GetStaticNameOfClass();
         typedef std::vector<TimePointType> TimePointVector;
         TimePointVector timePoints;
 
         if (dictionary.HasKey(PROPERTY_NAME_TIMEGEOMETRY_TIMEPOINTS))
         {
           timePoints = ConvertMetaDataObjectToTimePointList(dictionary.Get(PROPERTY_NAME_TIMEGEOMETRY_TIMEPOINTS));
         }
         else if (dictionary.HasKey(PROPERTY_KEY_TIMEGEOMETRY_TIMEPOINTS))
         {
           timePoints = ConvertMetaDataObjectToTimePointList(dictionary.Get(PROPERTY_KEY_TIMEGEOMETRY_TIMEPOINTS));
         }
 
         if (timePoints.empty())
         {
           MITK_ERROR << "Stored timepoints are empty. Meta information seems to bee invalid. Switch to ProportionalTimeGeometry fallback";
         }
         else if (timePoints.size() - 1 != image->GetDimension(3))
         {
           MITK_ERROR << "Stored timepoints (" << timePoints.size() - 1 << ") and size of image time dimension ("
             << image->GetDimension(3) << ") do not match. Switch to ProportionalTimeGeometry fallback";
         }
         else
         {
           ArbitraryTimeGeometry::Pointer arbitraryTimeGeometry = ArbitraryTimeGeometry::New();
           TimePointVector::const_iterator pos = timePoints.begin();
           auto prePos = pos++;
 
           for (; pos != timePoints.end(); ++prePos, ++pos)
           {
             arbitraryTimeGeometry->AppendNewTimeStepClone(slicedGeometry, *prePos, *pos);
           }
 
           timeGeometry = arbitraryTimeGeometry;
         }
       }
     }
 
     if (timeGeometry.IsNull())
     { // Fallback. If no other valid time geometry has been created, create a ProportionalTimeGeometry
       MITK_INFO << "used time geometry: " << ProportionalTimeGeometry::GetStaticNameOfClass();
       ProportionalTimeGeometry::Pointer propTimeGeometry = ProportionalTimeGeometry::New();
       propTimeGeometry->Initialize(slicedGeometry, image->GetDimension(3));
       timeGeometry = propTimeGeometry;
     }
 
     image->SetTimeGeometry(timeGeometry);
 
     buffer = nullptr;
     MITK_INFO << "number of image components: " << image->GetPixelType().GetNumberOfComponents();
 
     // end regular image loading
 
     LabelSetImage::Pointer output = ConvertImageToLabelSetImage(image);
 
     // get labels and add them as properties to the image
     char keybuffer[256];
 
     unsigned int numberOfLayers = GetIntByKey(dictionary, "layers");
     std::string _xmlStr;
     mitk::Label::Pointer label;
 
     for (unsigned int layerIdx = 0; layerIdx < numberOfLayers; layerIdx++)
     {
       sprintf(keybuffer, "layer_%03u", layerIdx);
       int numberOfLabels = GetIntByKey(dictionary, keybuffer);
 
       mitk::LabelSet::Pointer labelSet = mitk::LabelSet::New();
 
       for (int labelIdx = 0; labelIdx < numberOfLabels; labelIdx++)
       {
-        TiXmlDocument doc;
+        tinyxml2::XMLDocument doc;
         sprintf(keybuffer, "label_%03u_%05d", layerIdx, labelIdx);
         _xmlStr = GetStringByKey(dictionary, keybuffer);
-        doc.Parse(_xmlStr.c_str());
+        doc.Parse(_xmlStr.c_str(), _xmlStr.size());
 
-        TiXmlElement *labelElem = doc.FirstChildElement("Label");
+        auto *labelElem = doc.FirstChildElement("Label");
         if (labelElem == nullptr)
           mitkThrow() << "Error parsing NRRD header for mitk::LabelSetImage IO";
 
-        label = mitk::LabelSetIOHelper::LoadLabelFromTiXmlDocument(labelElem);
+        label = mitk::LabelSetIOHelper::LoadLabelFromXMLDocument(labelElem);
 
         if (label->GetValue() == 0) // set exterior label is needed to hold exterior information
           output->SetExteriorLabel(label);
         labelSet->AddLabel(label);
         labelSet->SetLayer(layerIdx);
       }
       output->AddLabelSetToLayer(layerIdx, labelSet);
     }
 
     for (auto iter = dictionary.Begin(), iterEnd = dictionary.End(); iter != iterEnd;
       ++iter)
     {
       if (iter->second->GetMetaDataObjectTypeInfo() == typeid(std::string))
       {
         const std::string& key = iter->first;
         std::string assumedPropertyName = key;
         std::replace(assumedPropertyName.begin(), assumedPropertyName.end(), '_', '.');
 
         std::string mimeTypeName = GetMimeType()->GetName();
 
         // Check if there is already a info for the key and our mime type.
         mitk::CoreServicePointer<IPropertyPersistence> propPersistenceService(mitk::CoreServices::GetPropertyPersistence());
         IPropertyPersistence::InfoResultType infoList = propPersistenceService->GetInfoByKey(key);
 
         auto predicate = [&mimeTypeName](const PropertyPersistenceInfo::ConstPointer& x) {
           return x.IsNotNull() && x->GetMimeTypeName() == mimeTypeName;
         };
         auto finding = std::find_if(infoList.begin(), infoList.end(), predicate);
 
         if (finding == infoList.end())
         {
           auto predicateWild = [](const PropertyPersistenceInfo::ConstPointer& x) {
             return x.IsNotNull() && x->GetMimeTypeName() == PropertyPersistenceInfo::ANY_MIMETYPE_NAME();
           };
           finding = std::find_if(infoList.begin(), infoList.end(), predicateWild);
         }
 
         PropertyPersistenceInfo::ConstPointer info;
 
         if (finding != infoList.end())
         {
           assumedPropertyName = (*finding)->GetName();
           info = *finding;
         }
         else
         { // we have not found anything suitable so we generate our own info
           auto newInfo = PropertyPersistenceInfo::New();
           newInfo->SetNameAndKey(assumedPropertyName, key);
           newInfo->SetMimeTypeName(PropertyPersistenceInfo::ANY_MIMETYPE_NAME());
           info = newInfo;
         }
 
         std::string value =
           dynamic_cast<itk::MetaDataObject<std::string>*>(iter->second.GetPointer())->GetMetaDataObjectValue();
 
         mitk::BaseProperty::Pointer loadedProp = info->GetDeserializationFunction()(value);
 
         output->SetProperty(assumedPropertyName.c_str(), loadedProp);
 
         // Read properties should be persisted unless they are default properties
         // which are written anyway
         bool isDefaultKey = false;
 
         for (const auto& defaultKey : m_DefaultMetaDataKeys)
         {
           if (defaultKey.length() <= assumedPropertyName.length())
           {
             // does the start match the default key
             if (assumedPropertyName.substr(0, defaultKey.length()).find(defaultKey) != std::string::npos)
             {
               isDefaultKey = true;
               break;
             }
           }
         }
 
         if (!isDefaultKey)
         {
           propPersistenceService->AddInfo(info);
         }
       }
     }
 
     // Handle UID
     if (dictionary.HasKey(PROPERTY_KEY_UID))
     {
       itk::MetaDataObject<std::string>::ConstPointer uidData = dynamic_cast<const itk::MetaDataObject<std::string>*>(dictionary.Get(PROPERTY_KEY_UID));
       if (uidData.IsNotNull())
       {
         mitk::UIDManipulator uidManipulator(output);
         uidManipulator.SetUID(uidData->GetMetaDataObjectValue());
       }
     }
 
     MITK_INFO << "...finished!";
 
     std::vector<BaseData::Pointer> result;
     result.push_back(output.GetPointer());
     return result;
   }
 
   int LabelSetImageIO::GetIntByKey(const itk::MetaDataDictionary &dic, const std::string &str)
   {
     std::vector<std::string> imgMetaKeys = dic.GetKeys();
     std::vector<std::string>::const_iterator itKey = imgMetaKeys.begin();
     std::string metaString("");
     for (; itKey != imgMetaKeys.end(); itKey++)
     {
       itk::ExposeMetaData<std::string>(dic, *itKey, metaString);
       if (itKey->find(str.c_str()) != std::string::npos)
       {
         return atoi(metaString.c_str());
       }
     }
     return 0;
   }
 
   std::string LabelSetImageIO::GetStringByKey(const itk::MetaDataDictionary &dic, const std::string &str)
   {
     std::vector<std::string> imgMetaKeys = dic.GetKeys();
     std::vector<std::string>::const_iterator itKey = imgMetaKeys.begin();
     std::string metaString("");
     for (; itKey != imgMetaKeys.end(); itKey++)
     {
       itk::ExposeMetaData<std::string>(dic, *itKey, metaString);
       if (itKey->find(str.c_str()) != std::string::npos)
       {
         return metaString;
       }
     }
     return metaString;
   }
 
   LabelSetImageIO *LabelSetImageIO::IOClone() const { return new LabelSetImageIO(*this); }
 
   void LabelSetImageIO::InitializeDefaultMetaDataKeys()
   {
     this->m_DefaultMetaDataKeys.push_back("NRRD.space");
     this->m_DefaultMetaDataKeys.push_back("NRRD.kinds");
     this->m_DefaultMetaDataKeys.push_back(PROPERTY_NAME_TIMEGEOMETRY_TYPE);
     this->m_DefaultMetaDataKeys.push_back(PROPERTY_NAME_TIMEGEOMETRY_TIMEPOINTS);
     this->m_DefaultMetaDataKeys.push_back("ITK.InputFilterName");
     this->m_DefaultMetaDataKeys.push_back("label_");
     this->m_DefaultMetaDataKeys.push_back("layer_");
   }
 
 } // namespace
 
 #endif //__mitkLabelSetImageWriter__cpp
diff --git a/Modules/Multilabel/mitkLabel.cpp b/Modules/Multilabel/mitkLabel.cpp
index b7952a6ef9..f2b6df44c5 100644
--- a/Modules/Multilabel/mitkLabel.cpp
+++ b/Modules/Multilabel/mitkLabel.cpp
@@ -1,299 +1,298 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkLabel.h"
 
 #include "itkProcessObject.h"
-#include "tinyxml.h"
 #include <itkCommand.h>
 #include <mitkProperties.h>
 #include <mitkDICOMSegmentationPropertyHelper.h>
 #include <mitkStringProperty.h>
 
 const mitk::Label::PixelType mitk::Label::MAX_LABEL_VALUE = std::numeric_limits<mitk::Label::PixelType>::max();
 
 mitk::Label::Label() : PropertyList()
 {
   if (GetProperty("locked") == nullptr)
     SetLocked(true);
   if (GetProperty("visible") == nullptr)
     SetVisible(true);
   if (GetProperty("opacity") == nullptr)
     SetOpacity(0.6);
   if (GetProperty("center.coordinates") == nullptr)
   {
     mitk::Point3D pnt;
     pnt.SetElement(0, 0);
     pnt.SetElement(1, 0);
     pnt.SetElement(2, 0);
     SetCenterOfMassCoordinates(pnt);
   }
   if (GetProperty("center.index") == nullptr)
   {
     mitk::Point3D pnt;
     pnt.SetElement(0, 0);
     pnt.SetElement(1, 0);
     pnt.SetElement(2, 0);
     SetCenterOfMassIndex(pnt);
   }
   if (GetProperty("color") == nullptr)
   {
     mitk::Color col;
     col.Set(0, 0, 0);
     SetColor(col);
   }
   if (GetProperty("name") == nullptr)
     SetName("noName!");
   if (GetProperty("value") == nullptr)
     SetValue(0);
   if (GetProperty("layer") == nullptr)
     SetLayer(0);
 
   DICOMSegmentationPropertyHelper::SetDICOMSegmentProperties(this);
 }
 
 mitk::Label::Label(const Label &other) : PropertyList(other)
 // copyconstructer of property List handles the coping action
 {
   auto *map = this->GetMap();
   auto it = map->begin();
   auto end = map->end();
 
   for (; it != end; ++it)
   {
     itk::SimpleMemberCommand<Label>::Pointer command = itk::SimpleMemberCommand<Label>::New();
     command->SetCallbackFunction(this, &Label::Modified);
     it->second->AddObserver(itk::ModifiedEvent(), command);
   }
 }
 
 mitk::Label::~Label()
 {
 }
 
 void mitk::Label::SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName, bool fallBackOnDefaultContext)
 {
   itk::SimpleMemberCommand<Label>::Pointer command = itk::SimpleMemberCommand<Label>::New();
   command->SetCallbackFunction(this, &Label::Modified);
   property->AddObserver(itk::ModifiedEvent(), command);
 
   Superclass::SetProperty(propertyKey, property, contextName, fallBackOnDefaultContext);
 }
 
 void mitk::Label::SetLocked(bool locked)
 {
   mitk::BoolProperty *property = dynamic_cast<mitk::BoolProperty *>(GetProperty("locked"));
   if (property != nullptr)
     // Update Property
     property->SetValue(locked);
   else
     // Create new Property
     SetBoolProperty("locked", locked);
 }
 
 bool mitk::Label::GetLocked() const
 {
   bool locked;
   GetBoolProperty("locked", locked);
   return locked;
 }
 
 void mitk::Label::SetVisible(bool visible)
 {
   mitk::BoolProperty *property = dynamic_cast<mitk::BoolProperty *>(GetProperty("visible"));
   if (property != nullptr)
     // Update Property
     property->SetValue(visible);
   else
     // Create new Property
     SetBoolProperty("visible", visible);
 }
 
 bool mitk::Label::GetVisible() const
 {
   bool visible;
   GetBoolProperty("visible", visible);
   return visible;
 }
 
 void mitk::Label::SetOpacity(float opacity)
 {
   mitk::FloatProperty *property = dynamic_cast<mitk::FloatProperty *>(GetProperty("opacity"));
   if (property != nullptr)
     // Update Property
     property->SetValue(opacity);
   else
     // Create new Property
     SetFloatProperty("opacity", opacity);
 }
 
 float mitk::Label::GetOpacity() const
 {
   float opacity;
   GetFloatProperty("opacity", opacity);
   return opacity;
 }
 
 void mitk::Label::SetName(const std::string &name)
 {
   SetStringProperty("name", name.c_str());
 }
 
 std::string mitk::Label::GetName() const
 {
   std::string name;
   GetStringProperty("name", name);
   return name;
 }
 
 void mitk::Label::SetValue(PixelType pixelValue)
 {
   mitk::UShortProperty *property = dynamic_cast<mitk::UShortProperty *>(GetProperty("value"));
   if (property != nullptr)
     // Update Property
     property->SetValue(pixelValue);
   else
     // Create new Property
     SetProperty("value", mitk::UShortProperty::New(pixelValue));
 }
 
 mitk::Label::PixelType mitk::Label::GetValue() const
 {
   PixelType pixelValue;
   mitk::UShortProperty *property = dynamic_cast<UShortProperty *>(GetProperty("value"));
   assert(property);
   pixelValue = property->GetValue();
   return pixelValue;
 }
 
 void mitk::Label::SetLayer(unsigned int layer)
 {
   mitk::UIntProperty *property = dynamic_cast<mitk::UIntProperty *>(GetProperty("layer"));
   if (property != nullptr)
     // Update Property
     property->SetValue(layer);
   else
     // Create new Property
     SetProperty("layer", mitk::UIntProperty::New(layer));
 }
 
 unsigned int mitk::Label::GetLayer() const
 {
   unsigned int layer;
   mitk::UIntProperty *prop = dynamic_cast<mitk::UIntProperty *>(GetProperty("layer"));
   layer = prop->GetValue();
   return layer;
 }
 
 const mitk::Color &mitk::Label::GetColor() const
 {
   mitk::ColorProperty *colorProp = dynamic_cast<mitk::ColorProperty *>(GetProperty("color"));
   return colorProp->GetColor();
 }
 
 void mitk::Label::SetColor(const mitk::Color &_color)
 {
   mitk::ColorProperty *colorProp = dynamic_cast<mitk::ColorProperty *>(GetProperty("color"));
   if (colorProp != nullptr)
     // Update Property
     colorProp->SetColor(_color);
   else
     // Create new Property
     SetProperty("color", mitk::ColorProperty::New(_color));
 }
 
 void mitk::Label::SetCenterOfMassIndex(const mitk::Point3D &center)
 {
   mitk::Point3dProperty *property = dynamic_cast<mitk::Point3dProperty *>(GetProperty("center.index"));
   if (property != nullptr)
     // Update Property
     property->SetValue(center);
   else
     // Create new Property
     SetProperty("center.index", mitk::Point3dProperty::New(center));
 }
 
 mitk::Point3D mitk::Label::GetCenterOfMassIndex() const
 {
   mitk::Point3dProperty *property = dynamic_cast<mitk::Point3dProperty *>(GetProperty("center.index"));
   return property->GetValue();
 }
 
 void mitk::Label::SetCenterOfMassCoordinates(const mitk::Point3D &center)
 {
   mitk::Point3dProperty *property = dynamic_cast<mitk::Point3dProperty *>(GetProperty("center.coordinates"));
   if (property != nullptr)
     // Update Property
     property->SetValue(center);
   else
     // Create new Property
     SetProperty("center.coordinates", mitk::Point3dProperty::New(center));
 }
 
 mitk::Point3D mitk::Label::GetCenterOfMassCoordinates() const
 {
   mitk::Point3dProperty *property = dynamic_cast<mitk::Point3dProperty *>(GetProperty("center.coordinates"));
   return property->GetValue();
 }
 
 itk::LightObject::Pointer mitk::Label::InternalClone() const
 {
   itk::LightObject::Pointer result(new Self(*this));
   result->UnRegister();
   return result;
 }
 
 void mitk::Label::PrintSelf(std::ostream & /*os*/, itk::Indent /*indent*/) const
 {
   // todo
 }
 
 bool mitk::Equal(const mitk::Label &leftHandSide, const mitk::Label &rightHandSide, ScalarType /*eps*/, bool verbose)
 {
   MITK_INFO(verbose) << "--- Label Equal ---";
 
   bool returnValue = true;
   // have to be replaced until a PropertyList Equal was implemented :
   // returnValue = mitk::Equal((const mitk::PropertyList &)leftHandSide,(const mitk::PropertyList
   // &)rightHandSide,eps,verbose);
 
   const mitk::PropertyList::PropertyMap *lhsmap = leftHandSide.GetMap();
   const mitk::PropertyList::PropertyMap *rhsmap = rightHandSide.GetMap();
 
   returnValue = lhsmap->size() == rhsmap->size();
 
   if (!returnValue)
   {
     MITK_INFO(verbose) << "Labels in label container are not equal.";
     return returnValue;
   }
 
   auto lhsmapIt = lhsmap->begin();
   auto lhsmapItEnd = lhsmap->end();
 
   for (; lhsmapIt != lhsmapItEnd; ++lhsmapIt)
   {
     if (rhsmap->find(lhsmapIt->first) == rhsmap->end())
     {
       returnValue = false;
       break;
     }
   }
 
   if (!returnValue)
   {
     MITK_INFO(verbose) << "Labels in label container are not equal.";
     return returnValue;
   }
 
   return returnValue;
 }
diff --git a/Modules/Multilabel/mitkLabel.h b/Modules/Multilabel/mitkLabel.h
index 2cf6e84fed..c4e8bdeafc 100644
--- a/Modules/Multilabel/mitkLabel.h
+++ b/Modules/Multilabel/mitkLabel.h
@@ -1,107 +1,104 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef __mitkLabel_H_
 #define __mitkLabel_H_
 
 #include "MitkMultilabelExports.h"
 #include <mitkColorProperty.h>
 #include <mitkPropertyList.h>
 #include <mitkVector.h>
 
-class TiXmlDocument;
-class TiXmlElement;
-
 namespace mitk
 {
   //##
   //##Documentation
   //## @brief A data structure describing a label.
   //## @ingroup Data
   //##
   class MITKMULTILABEL_EXPORT Label : public PropertyList
   {
   public:
     mitkClassMacro(Label, mitk::PropertyList);
 
     itkNewMacro(Self);
 
     typedef unsigned short PixelType;
 
     /// The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535
     static const PixelType MAX_LABEL_VALUE;
 
     void SetLocked(bool locked);
     bool GetLocked() const;
 
     void SetVisible(bool visible);
     bool GetVisible() const;
 
     void SetOpacity(float opacity);
     float GetOpacity() const;
 
     void SetName(const std::string &name);
     std::string GetName() const;
 
     void SetCenterOfMassIndex(const mitk::Point3D &center);
     mitk::Point3D GetCenterOfMassIndex() const;
 
     void SetCenterOfMassCoordinates(const mitk::Point3D &center);
     mitk::Point3D GetCenterOfMassCoordinates() const;
 
     void SetColor(const mitk::Color &);
     const mitk::Color &GetColor() const;
 
     void SetValue(PixelType pixelValue);
     PixelType GetValue() const;
 
     void SetLayer(unsigned int layer);
     unsigned int GetLayer() const;
 
     void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
 
     using itk::Object::Modified;
     void Modified() { Superclass::Modified(); }
     Label();
     ~Label() override;
 
   protected:
     void PrintSelf(std::ostream &os, itk::Indent indent) const override;
 
     Label(const Label &other);
 
   private:
     itk::LightObject::Pointer InternalClone() const override;
   };
 
   /**
   * @brief Equal A function comparing two labels for beeing equal in data
   *
   * @ingroup MITKTestingAPI
   *
   * Following aspects are tested for equality:
   *  - Lebel equality via Equal-PropetyList
   *
   * @param rightHandSide An image to be compared
   * @param leftHandSide An image to be compared
   * @param eps Tolarence for comparison. You can use mitk::eps in most cases.
   * @param verbose Flag indicating if the user wants detailed console output or not.
   * @return true, if all subsequent comparisons are true, false otherwise
   */
   MITKMULTILABEL_EXPORT bool Equal(const mitk::Label &leftHandSide,
                                    const mitk::Label &rightHandSide,
                                    ScalarType eps,
                                    bool verbose);
 
 } // namespace mitk
 
 #endif // __mitkLabel_H_
diff --git a/Modules/Multilabel/mitkLabelSetIOHelper.cpp b/Modules/Multilabel/mitkLabelSetIOHelper.cpp
index 1149e997f0..70d5e47426 100644
--- a/Modules/Multilabel/mitkLabelSetIOHelper.cpp
+++ b/Modules/Multilabel/mitkLabelSetIOHelper.cpp
@@ -1,264 +1,271 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkLabelSetIOHelper.h"
 
 #include "mitkLabelSetImage.h"
 #include <mitkBasePropertySerializer.h>
-#include <tinyxml.h>
+
+#include <tinyxml2.h>
 
 namespace
 {
   std::string EnsureExtension(const std::string& filename)
   {
     const std::string extension = ".lsetp";
 
     if (filename.size() < extension.size() || std::string::npos == filename.find(extension, filename.size() - extension.size()))
       return filename + extension;
 
     return filename;
   }
 }
 
 bool mitk::LabelSetIOHelper::SaveLabelSetImagePreset(const std::string &presetFilename,
                                                      mitk::LabelSetImage::Pointer &inputImage)
 {
   const auto filename = EnsureExtension(presetFilename);
 
-  TiXmlDocument xmlDocument;
-  xmlDocument.LinkEndChild(new TiXmlDeclaration("1.0", "", ""));
+  tinyxml2::XMLDocument xmlDocument;
+  xmlDocument.InsertEndChild(xmlDocument.NewDeclaration());
 
-  auto *rootElement = new TiXmlElement("LabelSetImagePreset");
+  auto *rootElement = xmlDocument.NewElement("LabelSetImagePreset");
   rootElement->SetAttribute("layers", inputImage->GetNumberOfLayers());
-  xmlDocument.LinkEndChild(rootElement);
+  xmlDocument.InsertEndChild(rootElement);
 
   for (unsigned int layerIndex = 0; layerIndex < inputImage->GetNumberOfLayers(); layerIndex++)
   {
-    auto *layerElement = new TiXmlElement("Layer");
+    auto *layerElement = xmlDocument.NewElement("Layer");
     layerElement->SetAttribute("index", layerIndex);
     layerElement->SetAttribute("labels", inputImage->GetNumberOfLabels(layerIndex));
-    rootElement->LinkEndChild(layerElement);
+    rootElement->InsertEndChild(layerElement);
 
     for (unsigned int labelIndex = 0; labelIndex < inputImage->GetNumberOfLabels(layerIndex); labelIndex++)
-      layerElement->LinkEndChild(LabelSetIOHelper::GetLabelAsTiXmlElement(inputImage->GetLabel(labelIndex, layerIndex)));
+      layerElement->InsertEndChild(LabelSetIOHelper::GetLabelAsXMLElement(xmlDocument, inputImage->GetLabel(labelIndex, layerIndex)));
   }
 
-  return xmlDocument.SaveFile(filename);
+  return tinyxml2::XML_SUCCESS == xmlDocument.SaveFile(filename.c_str());
 }
 
 void mitk::LabelSetIOHelper::LoadLabelSetImagePreset(const std::string &presetFilename,
                                                      mitk::LabelSetImage::Pointer &inputImage)
 {
   if (inputImage.IsNull())
     return;
 
   const auto filename = EnsureExtension(presetFilename);
 
-  TiXmlDocument xmlDocument;
+  tinyxml2::XMLDocument xmlDocument;
 
-  if(!xmlDocument.LoadFile(filename))
+  if(tinyxml2::XML_SUCCESS != xmlDocument.LoadFile(filename.c_str()))
     return;
 
   auto *rootElement = xmlDocument.FirstChildElement("LabelSetImagePreset");
 
   if (nullptr == rootElement)
   {
     MITK_WARN << "Not a valid LabelSet preset";
     return;
   }
 
   auto activeLayerBackup = inputImage->GetActiveLayer();
 
   int numberOfLayers = 0;
   rootElement->QueryIntAttribute("layers", &numberOfLayers);
 
   auto* layerElement = rootElement->FirstChildElement("Layer");
 
   if (nullptr == layerElement)
   {
     MITK_WARN << "LabelSet preset does not contain any layers";
     return;
   }
 
   for (int layerIndex = 0; layerIndex < numberOfLayers; layerIndex++)
   {
     int numberOfLabels = 0;
     layerElement->QueryIntAttribute("labels", &numberOfLabels);
 
     if (nullptr == inputImage->GetLabelSet(layerIndex))
     {
       inputImage->AddLayer();
     }
     else
     {
       inputImage->SetActiveLayer(layerIndex);
     }
 
     auto *labelElement = layerElement->FirstChildElement("Label");
 
     if (nullptr == labelElement)
       continue;
 
     for (int labelIndex = 0; labelIndex < numberOfLabels; labelIndex++)
     {
-      auto label = mitk::LabelSetIOHelper::LoadLabelFromTiXmlDocument(labelElement);
+      auto label = mitk::LabelSetIOHelper::LoadLabelFromXMLDocument(labelElement);
       const auto labelValue = label->GetValue();
 
       if (0 != labelValue)
       {
         auto* labelSet = inputImage->GetLabelSet(layerIndex);
         auto* alreadyExistingLabel = labelSet->GetLabel(labelValue);
 
         if (nullptr != alreadyExistingLabel)
         {
           // Override existing label with label from preset
           alreadyExistingLabel->ConcatenatePropertyList(label);
           labelSet->UpdateLookupTable(labelValue);
         }
         else
         {
           labelSet->AddLabel(label);
         }
       }
 
       labelElement = labelElement->NextSiblingElement("Label");
 
       if (nullptr == labelElement)
         continue;
     }
 
     layerElement = layerElement->NextSiblingElement("Layer");
 
     if (nullptr == layerElement)
       continue;
   }
 
   inputImage->SetActiveLayer(activeLayerBackup);
 }
 
-TiXmlElement *mitk::LabelSetIOHelper::GetLabelAsTiXmlElement(Label *label)
+tinyxml2::XMLElement *mitk::LabelSetIOHelper::GetLabelAsXMLElement(tinyxml2::XMLDocument &doc, Label *label)
 {
-  auto *labelElem = new TiXmlElement("Label");
+  auto *labelElem = doc.NewElement("Label");
 
   // add XML contents
   const PropertyList::PropertyMap *propmap = label->GetMap();
   for (auto iter = propmap->begin(); iter != propmap->end(); ++iter)
   {
     std::string key = iter->first;
     const BaseProperty *property = iter->second;
-    TiXmlElement *element = PropertyToXmlElem(key, property);
+    auto *element = PropertyToXMLElement(doc, key, property);
     if (element)
-      labelElem->LinkEndChild(element);
+      labelElem->InsertEndChild(element);
   }
   return labelElem;
 }
 
-mitk::Label::Pointer mitk::LabelSetIOHelper::LoadLabelFromTiXmlDocument(TiXmlElement *labelElem)
+mitk::Label::Pointer mitk::LabelSetIOHelper::LoadLabelFromXMLDocument(const tinyxml2::XMLElement *labelElem)
 {
   // reread
-  TiXmlElement *propElem = labelElem->FirstChildElement("property");
+  auto *propElem = labelElem->FirstChildElement("property");
 
   std::string name;
   mitk::BaseProperty::Pointer prop;
 
   mitk::Label::Pointer label = mitk::Label::New();
   while (propElem)
   {
-    LabelSetIOHelper::PropertyFromXmlElem(name, prop, propElem);
+    LabelSetIOHelper::PropertyFromXMLElement(name, prop, propElem);
     label->SetProperty(name, prop);
     propElem = propElem->NextSiblingElement("property");
   }
 
   return label.GetPointer();
 }
 
-TiXmlElement *mitk::LabelSetIOHelper::PropertyToXmlElem(const std::string &key, const BaseProperty *property)
+tinyxml2::XMLElement *mitk::LabelSetIOHelper::PropertyToXMLElement(tinyxml2::XMLDocument &doc, const std::string &key, const BaseProperty *property)
 {
-  auto *keyelement = new TiXmlElement("property");
-  keyelement->SetAttribute("key", key);
+  auto *keyelement = doc.NewElement("property");
+  keyelement->SetAttribute("key", key.c_str());
   keyelement->SetAttribute("type", property->GetNameOfClass());
 
   // construct name of serializer class
   std::string serializername(property->GetNameOfClass());
   serializername += "Serializer";
 
   std::list<itk::LightObject::Pointer> allSerializers =
     itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
   if (allSerializers.size() < 1)
     MITK_ERROR << "No serializer found for " << property->GetNameOfClass() << ". Skipping object";
 
   if (allSerializers.size() > 1)
     MITK_WARN << "Multiple serializers found for " << property->GetNameOfClass() << "Using arbitrarily the first one.";
 
   for (auto iter = allSerializers.begin(); iter != allSerializers.end();
        ++iter)
   {
     if (auto *serializer = dynamic_cast<BasePropertySerializer *>(iter->GetPointer()))
     {
       serializer->SetProperty(property);
       try
       {
-        TiXmlElement *valueelement = serializer->Serialize();
+        auto *valueelement = serializer->Serialize(doc);
         if (valueelement)
-          keyelement->LinkEndChild(valueelement);
+          keyelement->InsertEndChild(valueelement);
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Serializer " << serializer->GetNameOfClass() << " failed: " << e.what();
       }
       break;
     }
   }
   return keyelement;
 }
 
-bool mitk::LabelSetIOHelper::PropertyFromXmlElem(std::string &key,
-                                                 mitk::BaseProperty::Pointer &prop,
-                                                 TiXmlElement *elem)
+bool mitk::LabelSetIOHelper::PropertyFromXMLElement(std::string &key,
+                                                    mitk::BaseProperty::Pointer &prop,
+                                                    const tinyxml2::XMLElement *elem)
 {
-  std::string type;
-  elem->QueryStringAttribute("type", &type);
-  elem->QueryStringAttribute("key", &key);
+  const char* typeC = elem->Attribute("type");
+  std::string type = nullptr != typeC
+    ? typeC
+    : "";
+
+  const char* keyC = elem->Attribute("key");
+  key = nullptr != keyC
+    ? keyC
+    : "";
 
   // construct name of serializer class
   std::string serializername(type);
   serializername += "Serializer";
 
   std::list<itk::LightObject::Pointer> allSerializers =
     itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
   if (allSerializers.size() < 1)
     MITK_ERROR << "No serializer found for " << type << ". Skipping object";
 
   if (allSerializers.size() > 1)
     MITK_WARN << "Multiple deserializers found for " << type << "Using arbitrarily the first one.";
 
   for (auto iter = allSerializers.begin(); iter != allSerializers.end();
        ++iter)
   {
     if (auto *serializer = dynamic_cast<BasePropertySerializer *>(iter->GetPointer()))
     {
       try
       {
         prop = serializer->Deserialize(elem->FirstChildElement());
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Deserializer " << serializer->GetNameOfClass() << " failed: " << e.what();
         return false;
       }
       break;
     }
   }
   if (prop.IsNull())
     return false;
   return true;
 }
diff --git a/Modules/Multilabel/mitkLabelSetIOHelper.h b/Modules/Multilabel/mitkLabelSetIOHelper.h
index 3800fda33a..a43c16c686 100644
--- a/Modules/Multilabel/mitkLabelSetIOHelper.h
+++ b/Modules/Multilabel/mitkLabelSetIOHelper.h
@@ -1,91 +1,97 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef __mitkLabelSetIOHelper_h
 #define __mitkLabelSetIOHelper_h
 
 #include <MitkMultilabelExports.h>
 #include <itkSmartPointer.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   class BaseProperty;
   class LabelSetImage;
   class Label;
 
   /**
    * @brief The LabelSetIOHelper is a static helper class that supports serialization of mitk::LabelSetImage
    *
    * This class provides static functions for converting mitk::Label into XML and also allows the serialization
    * of mitk::LabelSet as presets
    */
   class MITKMULTILABEL_EXPORT LabelSetIOHelper
   {
   public:
     /**
      * @brief Saves the mitk::LabelSet configuration of inputImage to presetFilename.
      * The preset is stored as "*.lsetp"
      * @param presetFilename the filename including the filesystem path
      * @param inputImage the input image from which the preset should be generated
      * @return true if the serialization was successful and false otherwise
      */
     static bool SaveLabelSetImagePreset(const std::string &presetFilename,
                                         itk::SmartPointer<mitk::LabelSetImage> &inputImage);
 
     /**
      * @brief Loads an existing preset for a mitk::LabelSetImage from presetFilename and applies it to inputImage
      * @param presetFilename the filename of the preset including the filesystem path
      * @param inputImage the image to which the loaded preset will be applied
      */
     static void LoadLabelSetImagePreset(const std::string &presetFilename,
                                         itk::SmartPointer<mitk::LabelSetImage> &inputImage);
 
     /**
-     * @brief Creates a mitk::Label from a TiXmlElement
+     * @brief Creates a mitk::Label from an XML element
      * @param labelElem the xml element from which a mitk::Label will be created
      * @return the created mitk::Label
      */
-    static itk::SmartPointer<mitk::Label> LoadLabelFromTiXmlDocument(TiXmlElement *labelElem);
+    static itk::SmartPointer<mitk::Label> LoadLabelFromXMLDocument(const tinyxml2::XMLElement *labelElem);
 
     /**
-     * @brief Creates a TiXmlElement from a mitk::Label
+     * @brief Creates an XML element from a mitk::Label
+     * @param doc
      * @param label the mitk::Label from which the xml element will be created
-     * @return the created TiXmlElement
+     * @return the created XML element
      */
-    static TiXmlElement *GetLabelAsTiXmlElement(Label *label);
+    static tinyxml2::XMLElement *GetLabelAsXMLElement(tinyxml2::XMLDocument &doc, Label *label);
 
     /**
      * @brief Since a mitk::Label is basically a mitk::PropertyList this function coverts the label's properties into
      * XML
+     * @param doc
      * @param key the property's key which will be used in the XML element
      * @param property the mitk::BaseProperty that should be converted
-     * @return the created TiXmlElement
+     * @return the created XML element
      */
-    static TiXmlElement *PropertyToXmlElem(const std::string &key, const BaseProperty *property);
+    static tinyxml2::XMLElement *PropertyToXMLElement(tinyxml2::XMLDocument& doc, const std::string &key, const BaseProperty *property);
 
     /**
      * @brief Since a mitk::Label is basically a mitk::PropertyList this function coverts a XML element into a property
      * @param key the property's key
      * @param prop the mitk::BaseProperty that will be created
      * @param elem the XML elem from which the property will be created
      * @return true if the conversion was successful and false otherwise
      */
-    static bool PropertyFromXmlElem(std::string &key, itk::SmartPointer<mitk::BaseProperty> &prop, TiXmlElement *elem);
+    static bool PropertyFromXMLElement(std::string &key, itk::SmartPointer<mitk::BaseProperty> &prop, const tinyxml2::XMLElement *elem);
 
   private:
     LabelSetIOHelper();
   };
 }
 
 #endif // __mitkLabelSetIOHelper_h
diff --git a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.cpp b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.cpp
index d21581e8bf..213e8b4fc7 100644
--- a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.cpp
+++ b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.cpp
@@ -1,250 +1,263 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPropertyListsXmlFileReaderAndWriter.h"
 #include "mitkProperties.h"
 #include "mitkStandaloneDataStorage.h"
 #include <itksys/SystemTools.hxx>
-#include <tinyxml.h>
+#include <tinyxml2.h>
+
+namespace
+{
+  std::string ReadStringAttribute(const tinyxml2::XMLElement* elem, const char *name)
+  {
+    const char* attrib = elem->Attribute(name);
+
+    return attrib != nullptr
+      ? attrib
+      : "";
+  }
+}
 
 namespace mitk
 {
   bool PropertyListsXmlFileReaderAndWriter::PropertyFromXmlElem(std::string &name,
                                                                 mitk::BaseProperty::Pointer &prop,
-                                                                TiXmlElement *elem) const
+                                                                const tinyxml2::XMLElement *elem) const
   {
-    if (!elem)
+    if (nullptr == elem)
+      return false;
+
+    std::string type = ReadStringAttribute(elem, "type");
+
+    if (type.empty())
     {
+      MITK_WARN << "type attribute not found in property";
       return false;
     }
+      
+    name = ReadStringAttribute(elem, "name");
 
-    bool readOp = false;
-    std::string type = "";
-    readOp = elem->QueryStringAttribute("type", &type) == TIXML_SUCCESS;
-    if (readOp)
-      readOp = elem->QueryStringAttribute("name", &name) == TIXML_SUCCESS;
-    else
-      MITK_WARN << "type"
-                << " attribute not found in a property";
+    if (name.empty())
+    {
+      MITK_WARN << "name attribute not found in property";
+      return false;
+    }
 
-    if (readOp)
+    tinyxml2::XMLError err = tinyxml2::XML_SUCCESS;
+
+    if (type == "BoolProperty")
     {
-      if (type == "BoolProperty")
+      int val = 0;
+      err = elem->QueryIntAttribute("value", &val);
+      if (tinyxml2::XML_SUCCESS == err)
       {
-        int val = 0;
-        readOp = elem->QueryIntAttribute("value", &val) == TIXML_SUCCESS;
-        if (readOp)
-        {
-          prop = mitk::BoolProperty::New(val == 1 ? true : false);
-        }
+        prop = mitk::BoolProperty::New(val == 1 ? true : false);
       }
-      else if (type == "StringProperty")
+    }
+    else if (type == "StringProperty")
+    {
+      const auto* attrib = elem->FindAttribute("value");
+      
+      if (nullptr == attrib)
       {
-        std::string val = "";
-        readOp = elem->QueryStringAttribute("value", &val) == TIXML_SUCCESS;
-        if (readOp)
-        {
-          prop = mitk::StringProperty::New(val);
-        }
+        err = tinyxml2::XML_NO_ATTRIBUTE;
       }
-      else if (type == "IntProperty")
+      else
       {
-        int val = 0;
-        readOp = elem->QueryIntAttribute("value", &val) == TIXML_SUCCESS;
-        if (readOp)
-        {
-          prop = mitk::IntProperty::New(val);
-        }
+        auto val = ReadStringAttribute(elem, "value");
+        prop = mitk::StringProperty::New(val);
       }
-      else if (type == "DoubleProperty")
+    }
+    else if (type == "IntProperty")
+    {
+      int val = 0;
+      err = elem->QueryIntAttribute("value", &val);
+      if (tinyxml2::XML_SUCCESS == err)
       {
-        double val = 0;
-        readOp = elem->QueryDoubleAttribute("value", &val) == TIXML_SUCCESS;
-        if (readOp)
-        {
-          prop = mitk::DoubleProperty::New(val);
-        }
+        prop = mitk::IntProperty::New(val);
       }
-      else if (type == "FloatProperty")
+    }
+    else if (type == "DoubleProperty")
+    {
+      double val = 0;
+      err = elem->QueryDoubleAttribute("value", &val);
+      if (tinyxml2::XML_SUCCESS == err)
       {
-        float val = 0;
-        readOp = elem->QueryFloatAttribute("value", &val) == TIXML_SUCCESS;
-        if (readOp)
-        {
-          prop = mitk::FloatProperty::New(val);
-        }
+        prop = mitk::DoubleProperty::New(val);
       }
-      else
+    }
+    else if (type == "FloatProperty")
+    {
+      float val = 0;
+      err = elem->QueryFloatAttribute("value", &val);
+      if (tinyxml2::XML_SUCCESS == err)
       {
-        readOp = false;
-        MITK_WARN << "type"
-                  << " attribute unknown. Only BoolProperty, StringProperty, IntProperty, DoubleProperty or "
-                     "FloatProperty allowed.";
+        prop = mitk::FloatProperty::New(val);
       }
     }
     else
-      MITK_WARN << "name"
-                << " attribute not found in a property";
-
-    if (!readOp)
-      MITK_WARN << "value"
-                << " attribute not found in a property";
+    {
+      err = tinyxml2::XML_WRONG_ATTRIBUTE_TYPE;
+      MITK_WARN << "type attribute unknown. Only BoolProperty, StringProperty, IntProperty, DoubleProperty or FloatProperty allowed.";
+    }
 
-    return readOp;
+    return tinyxml2::XML_SUCCESS == err;
   }
+
   bool PropertyListsXmlFileReaderAndWriter::PropertyToXmlElem(const std::string &name,
                                                               const mitk::BaseProperty *prop,
-                                                              TiXmlElement *elem) const
+                                                              tinyxml2::XMLElement *elem) const
   {
-    if (!prop || !elem)
-    {
+    if (nullptr == prop || nullptr == elem)
       return false;
-    }
 
     const mitk::IntProperty *intProp = nullptr;
     const mitk::FloatProperty *floatProp = nullptr;
     const mitk::DoubleProperty *doubleProp = nullptr;
     const mitk::BoolProperty *boolProp = nullptr;
     const mitk::StringProperty *stringProp = nullptr;
     bool writeOp = true;
 
-    if ((boolProp = dynamic_cast<const BoolProperty *>(prop)))
+    if (nullptr != (boolProp = dynamic_cast<const BoolProperty *>(prop)))
     {
-      elem->SetAttribute(GetPropertyListIdElementName(), name);
+      elem->SetAttribute(GetPropertyListIdElementName(), name.c_str());
       elem->SetAttribute("value", boolProp->GetValue() ? 1 : 0);
       elem->SetAttribute("type", "BoolProperty");
     }
-    else if ((stringProp = dynamic_cast<const StringProperty *>(prop)))
+    else if (nullptr != (stringProp = dynamic_cast<const StringProperty *>(prop)))
     {
-      elem->SetAttribute(GetPropertyListIdElementName(), name);
+      elem->SetAttribute(GetPropertyListIdElementName(), name.c_str());
       elem->SetAttribute("value", stringProp->GetValue());
       elem->SetAttribute("type", "StringProperty");
     }
-    else if ((intProp = dynamic_cast<const IntProperty *>(prop)))
+    else if (nullptr != (intProp = dynamic_cast<const IntProperty *>(prop)))
     {
-      elem->SetAttribute(GetPropertyListIdElementName(), name);
+      elem->SetAttribute(GetPropertyListIdElementName(), name.c_str());
       elem->SetAttribute("value", intProp->GetValue());
       elem->SetAttribute("type", "IntProperty");
     }
-    else if ((doubleProp = dynamic_cast<const DoubleProperty *>(prop)))
+    else if (nullptr != (doubleProp = dynamic_cast<const DoubleProperty *>(prop)))
     {
-      elem->SetAttribute(GetPropertyListIdElementName(), name);
-      elem->SetDoubleAttribute("value", doubleProp->GetValue());
+      elem->SetAttribute(GetPropertyListIdElementName(), name.c_str());
+      elem->SetAttribute("value", doubleProp->GetValue());
       elem->SetAttribute("type", "DoubleProperty");
     }
-    else if ((floatProp = dynamic_cast<const FloatProperty *>(prop)))
+    else if (nullptr != (floatProp = dynamic_cast<const FloatProperty *>(prop)))
     {
-      elem->SetAttribute(GetPropertyListIdElementName(), name);
-      elem->SetDoubleAttribute("value", static_cast<float>(floatProp->GetValue()));
+      elem->SetAttribute(GetPropertyListIdElementName(), name.c_str());
+      elem->SetAttribute("value", floatProp->GetValue());
       elem->SetAttribute("type", "FloatProperty");
     }
     else
     {
       MITK_WARN("PropertyListImportFromXmlFile") << "Base property " << name << " is unknown";
       writeOp = false;
     }
     return writeOp;
   }
-  bool PropertyListsXmlFileReaderAndWriter::WriteLists(
-    const std::string &fileName, const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const
+
+  bool PropertyListsXmlFileReaderAndWriter::WriteLists(const std::string &fileName,
+                                                       const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const
   {
-    TiXmlDocument doc;
+    tinyxml2::XMLDocument doc;
+    doc.InsertEndChild(doc.NewDeclaration());
 
-    auto decl = new TiXmlDeclaration("1.0", "", "");
-    doc.LinkEndChild(decl);
     // create root
-    auto propertyListsElem = new TiXmlElement("PropertyLists");
+    auto *propertyListsElem = doc.NewElement("PropertyLists");
 
     bool allPropsConverted = true;
     auto it = _PropertyLists.begin();
     while (it != _PropertyLists.end())
     {
       const std::string &id = (*it).first;
       const PropertyList *propList = (*it).second;
-      auto propertyListElem = new TiXmlElement("PropertyList");
-      propertyListElem->SetAttribute(GetPropertyListIdElementName(), id);
+      auto *propertyListElem = doc.NewElement("PropertyList");
+      propertyListElem->SetAttribute(GetPropertyListIdElementName(), id.c_str());
 
       const std::map<std::string, BaseProperty::Pointer> *propMap = propList->GetMap();
       auto propMapIt = propMap->begin();
       while (propMapIt != propMap->end())
       {
         const std::string &propName = (*propMapIt).first;
         const BaseProperty *prop = (*propMapIt).second;
-        auto propertyElem = new TiXmlElement("Property");
+        auto *propertyElem = doc.NewElement("Property");
 
         if (!this->PropertyToXmlElem(propName, prop, propertyElem))
           allPropsConverted = false;
 
-        propertyListElem->LinkEndChild(propertyElem);
+        propertyListElem->InsertEndChild(propertyElem);
         ++propMapIt;
       }
 
-      propertyListsElem->LinkEndChild(propertyListElem);
+      propertyListsElem->InsertEndChild(propertyListElem);
       ++it;
     }
 
-    doc.LinkEndChild(propertyListsElem);
+    doc.InsertEndChild(propertyListsElem);
 
-    return (allPropsConverted && doc.SaveFile(fileName.c_str()));
+    return (allPropsConverted && tinyxml2::XML_SUCCESS == doc.SaveFile(fileName.c_str()));
   }
-  bool PropertyListsXmlFileReaderAndWriter::ReadLists(
-    const std::string &fileName, std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const
+
+  bool PropertyListsXmlFileReaderAndWriter::ReadLists(const std::string &fileName,
+                                                      std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const
   {
     // reread
-    TiXmlDocument doc(fileName);
-    doc.LoadFile();
+    tinyxml2::XMLDocument doc;
+    doc.LoadFile(fileName.c_str());
 
-    TiXmlHandle docHandle(&doc);
-    TiXmlElement *elem = docHandle.FirstChildElement("PropertyLists").FirstChildElement("PropertyList").ToElement();
+    tinyxml2::XMLHandle docHandle(&doc);
+    auto *elem = docHandle.FirstChildElement("PropertyLists").FirstChildElement("PropertyList").ToElement();
 
-    if (!elem)
+    if (nullptr == elem)
     {
       MITK_WARN("PropertyListFromXml") << "Cannot find a PropertyList element (inside a PropertyLists element)";
       return false;
     }
 
     bool opRead = false;
-    while (elem)
+    while (nullptr != elem)
     {
-      std::string propListId;
-      opRead = elem->QueryStringAttribute(GetPropertyListIdElementName(), &propListId) == TIXML_SUCCESS;
-      if (!opRead)
+      std::string propListId = ReadStringAttribute(elem, GetPropertyListIdElementName());
+      if (propListId.empty())
         break;
 
-      mitk::PropertyList::Pointer propList = mitk::PropertyList::New();
+      opRead = true;
+
+      auto propList = mitk::PropertyList::New();
 
-      TiXmlElement *propElem = elem->FirstChildElement("Property");
+      auto *propElem = elem->FirstChildElement("Property");
 
-      while (propElem)
+      while (nullptr != propElem)
       {
         std::string name;
         mitk::BaseProperty::Pointer prop;
         opRead = this->PropertyFromXmlElem(name, prop, propElem);
         if (!opRead)
           break;
         propList->SetProperty(name, prop);
         propElem = propElem->NextSiblingElement("Property");
       }
 
       if (!opRead)
         break;
       _PropertyLists[propListId] = propList;
       elem = elem->NextSiblingElement("PropertyList");
     }
 
     return opRead;
   }
 
   PropertyListsXmlFileReaderAndWriter::PropertyListsXmlFileReaderAndWriter() {}
   PropertyListsXmlFileReaderAndWriter::~PropertyListsXmlFileReaderAndWriter() {}
   const char *PropertyListsXmlFileReaderAndWriter::GetPropertyListIdElementName() { return "name"; }
 }
diff --git a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
index 57de09355f..4534c2d1f6 100644
--- a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
+++ b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
@@ -1,47 +1,50 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkXmlSceneIO_h_included
 #define mitkXmlSceneIO_h_included
 
 #include "mitkDataStorage.h"
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLElement;
+}
 
 namespace mitk
 {
   class PropertyListsXmlFileReaderAndWriter;
 
   class PropertyListsXmlFileReaderAndWriter : public itk::Object
   {
   public:
     static const char *GetPropertyListIdElementName();
 
     mitkClassMacroItkParent(PropertyListsXmlFileReaderAndWriter, itk::Object);
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
       bool WriteLists(const std::string &fileName,
                       const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
     bool ReadLists(const std::string &fileName,
                    std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
 
   protected:
     PropertyListsXmlFileReaderAndWriter();
     ~PropertyListsXmlFileReaderAndWriter() override;
 
-    bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, TiXmlElement *elem) const;
-    bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, TiXmlElement *elem) const;
+    bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, const tinyxml2::XMLElement *elem) const;
+    bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, tinyxml2::XMLElement *elem) const;
   };
 }
 
 #endif
diff --git a/Modules/PhotoacousticsAlgorithms/CMakeLists.txt b/Modules/PhotoacousticsAlgorithms/CMakeLists.txt
index 16ebe278d0..e503966264 100644
--- a/Modules/PhotoacousticsAlgorithms/CMakeLists.txt
+++ b/Modules/PhotoacousticsAlgorithms/CMakeLists.txt
@@ -1,19 +1,25 @@
 set(dependencies_list MitkCore MitkAlgorithmsExt MitkOpenCVVideoSupport)
 
 IF(MITK_USE_OpenCL)
   add_definitions(-DPHOTOACOUSTICS_USE_GPU)
   set(dependencies_list ${dependencies_list} MitkOpenCL)
   message("Using OpenCL in PhotoacousticAlgorithms")
 ENDIF(MITK_USE_OpenCL)
 
 MITK_CREATE_MODULE(
   DEPENDS ${dependencies_list}
   #AUTOLOAD_WITH MitkCore
   INCLUDE_DIRS PUBLIC include
   INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL}
-  PACKAGE_DEPENDS ITK|ITKFFT+ITKImageCompose+ITKImageIntensity OpenCV tinyxml
+  PACKAGE_DEPENDS ITK|ITKFFT+ITKImageCompose+ITKImageIntensity OpenCV tinyxml2|tinyxml2
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
+
 add_subdirectory(test)
 add_subdirectory(MitkPABeamformingTool)
 add_subdirectory(MitkPAResampleCropTool)
diff --git a/Modules/PhotoacousticsAlgorithms/MitkPABeamformingTool/CMakeLists.txt b/Modules/PhotoacousticsAlgorithms/MitkPABeamformingTool/CMakeLists.txt
index ba56da85ab..ef003473c5 100644
--- a/Modules/PhotoacousticsAlgorithms/MitkPABeamformingTool/CMakeLists.txt
+++ b/Modules/PhotoacousticsAlgorithms/MitkPABeamformingTool/CMakeLists.txt
@@ -1,11 +1,17 @@
 OPTION(BUILD_PhotoacousticBeamformingTool "Build MiniApp for beamforming of a PA image" OFF)
 
 IF(BUILD_PhotoacousticBeamformingTool)
   PROJECT( MitkPABeamformingTool )
     mitk_create_executable(PABeamformingTool
       DEPENDS MitkCommandLine MitkCore MitkPhotoacousticsAlgorithms
-      PACKAGE_DEPENDS tinyxml
+      PACKAGE_DEPENDS tinyxml2|tinyxml2
       CPP_FILES PABeamformingTool.cpp)
 
+  if(TARGET ${EXECUTABLE_TARGET})
+    target_link_libraries(${MODULE_TARGET}
+      PRIVATE tinyxml2::tinyxml2
+    )
+  endif()
+
   install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin)
  ENDIF()
diff --git a/Modules/PhotoacousticsAlgorithms/MitkPAResampleCropTool/CMakeLists.txt b/Modules/PhotoacousticsAlgorithms/MitkPAResampleCropTool/CMakeLists.txt
index eedce28006..517752db0d 100644
--- a/Modules/PhotoacousticsAlgorithms/MitkPAResampleCropTool/CMakeLists.txt
+++ b/Modules/PhotoacousticsAlgorithms/MitkPAResampleCropTool/CMakeLists.txt
@@ -1,11 +1,17 @@
 OPTION(BUILD_PhotoacousticResampleCropTool "Build MiniApp for resampling and cropping of images" OFF)
 
 IF(BUILD_PhotoacousticResampleCropTool)
   PROJECT( MitkPAResampleCropTool )
     mitk_create_executable(PAResampleCropTool
       DEPENDS MitkCommandLine MitkCore MitkPhotoacousticsAlgorithms
-      PACKAGE_DEPENDS tinyxml
+      PACKAGE_DEPENDS tinyxml2|tinyxml2
       CPP_FILES PAResampleCropTool.cpp)
 
+  if(TARGET ${EXECUTABLE_TARGET})
+    target_link_libraries(${MODULE_TARGET}
+      PRIVATE tinyxml2::tinyxml2
+    )
+  endif()
+
   install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin)
  ENDIF()
diff --git a/Modules/PhotoacousticsHardware/CMakeLists.txt b/Modules/PhotoacousticsHardware/CMakeLists.txt
index 12ff4f08ad..6ce8caa586 100644
--- a/Modules/PhotoacousticsHardware/CMakeLists.txt
+++ b/Modules/PhotoacousticsHardware/CMakeLists.txt
@@ -1,20 +1,26 @@
 if(WIN32)
 
   option(MITK_USE_GALIL_HARDWARE "Enable support for OPOTEK Lasers" OFF)
   option(MITK_USE_OPHIR_PYRO_HARDWARE "Enable support for Ophir Pyroelectrical Sensors" OFF)
 
   if(MITK_USE_OPHIR_PYRO_HARDWARE)
     set(MITK_OPHIR_API_PATH "" CACHE PATH "Path to Ophir API lib.")
   endif()
 
   if(MITK_USE_GALIL_HARDWARE)
     set(MITK_GALIL_API_PATH "" CACHE PATH "Path to Galil API header files.")
     MITK_CREATE_MODULE(
       DEPENDS MitkIGT
       INCLUDE_DIRS PUBLIC "${MITK_GALIL_API_PATH}/include" "${MITK_OPHIR_API_PATH}"
       INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL}
-      ADDITIONAL_LIBS "${MITK_GALIL_API_PATH}/lib/dynamic/x64/gclib.lib" "${MITK_GALIL_API_PATH}/lib/dynamic/x64/gclibo.lib" tinyxml "${MITK_OPHIR_API_PATH}/OphirPyroWrapper.lib"
-      PACKAGE_DEPENDS tinyxml
+      ADDITIONAL_LIBS "${MITK_GALIL_API_PATH}/lib/dynamic/x64/gclib.lib" "${MITK_GALIL_API_PATH}/lib/dynamic/x64/gclibo.lib" "${MITK_OPHIR_API_PATH}/OphirPyroWrapper.lib"
+      PACKAGE_DEPENDS tinyxml2|tinyxml2
     )
+
+    if(TARGET ${MODULE_TARGET})
+      target_link_libraries(${MODULE_TARGET}
+        PRIVATE tinyxml2::tinyxml2
+      )
+    endif()
   endif()
 endif()
diff --git a/Modules/PhotoacousticsLib/CMakeLists.txt b/Modules/PhotoacousticsLib/CMakeLists.txt
index 83269bc48d..881f0ffe29 100644
--- a/Modules/PhotoacousticsLib/CMakeLists.txt
+++ b/Modules/PhotoacousticsLib/CMakeLists.txt
@@ -1,16 +1,22 @@
 MITK_CREATE_MODULE(
   INCLUDE_DIRS PUBLIC include
   INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL}
-  DEPENDS PUBLIC MitkAlgorithmsExt tinyxml
+  DEPENDS PUBLIC MitkAlgorithmsExt
   PACKAGE_DEPENDS
-    tinyxml Vigra
+    tinyxml2|tinyxml2 Vigra
     PUBLIC ITK
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
+
 add_subdirectory(MitkMCxyz)
 
 add_subdirectory(MitkTissueBatchGenerator)
 add_subdirectory(MitkPAPhantomGenerator)
 add_subdirectory(MitkSpectralUnmixing)
 
 add_subdirectory(test)
diff --git a/Modules/PhotoacousticsLib/include/mitkPALightSource.h b/Modules/PhotoacousticsLib/include/mitkPALightSource.h
index b45d72f0b8..4dd982ea78 100644
--- a/Modules/PhotoacousticsLib/include/mitkPALightSource.h
+++ b/Modules/PhotoacousticsLib/include/mitkPALightSource.h
@@ -1,179 +1,182 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef MITKPHOTOACOUSTICLIGHTSOURCE_H
 #define MITKPHOTOACOUSTICLIGHTSOURCE_H
 
 #include <mitkCommon.h>
 
 #include "MitkPhotoacousticsLibExports.h"
 
 //Includes for smart pointer usage
 #include "mitkCommon.h"
 #include "itkObject.h"
 #include "itkMacro.h"
 
-#include <tinyxml.h>
+namespace tinyxml2 {
+  class XMLElement;
+}
 
 namespace mitk {
   namespace pa {
     /**
      * @brief The LightSource class
      * The representation of a LightSource
      */
     class MITKPHOTOACOUSTICSLIB_EXPORT LightSource : public itk::Object
     {
     public:
 
       mitkClassMacroItkParent(LightSource, itk::Object);
       itkFactorylessNewMacro(Self);
-      mitkNewMacro2Param(Self, TiXmlElement*, bool);
+      mitkNewMacro2Param(Self, const tinyxml2::XMLElement*, bool);
 
       const std::string XML_TAG_X_ANGLE = "xAngle";
       const std::string XML_TAG_Y_ANGLE = "yAngle";
       const std::string XML_TAG_PHOTON_DIRECTION = "PhotonDirection";
       const std::string XML_TAG_MINIMUM = "min";
       const std::string XML_TAG_MAXIMUM = "max";
       const std::string XML_TAG_MODE = "mode";
       const std::string XML_TAG_ENERGY = "energy";
       const std::string XML_TAG_SPAWN_TYPE = "SpawnType";
       const std::string XML_TAG_SPAWN_TYPE_POINT = "POINT";
       const std::string XML_TAG_SPAWN_TYPE_RECTANGLE = "RECTANGLE";
       const std::string XML_TAG_SPAWN_TYPE_CIRCLE = "CIRCLE";
       const std::string XML_TAG_X = "x";
       const std::string XML_TAG_Y = "y";
       const std::string XML_TAG_Z = "z";
       const std::string XML_TAG_R = "r";
       const std::string XML_TAG_X_LENGTH = "xLength";
       const std::string XML_TAG_Y_LENGTH = "yLength";
       const std::string XML_TAG_Z_LENGTH = "zLength";
 
       enum SpawnType
       {
         POINT, RECTANGLE, CIRCLE
       };
 
       enum DistributionMode
       {
         UNIFORM, GAUSSIAN
       };
 
       struct PhotonInformation
       {
         double xPosition;
         double yPosition;
         double zPosition;
         double xAngle;
         double yAngle;
         double zAngle;
       };
 
       PhotonInformation GetNextPhoton(double rnd1, double rnd2, double rnd3,
         double rnd4, double rnd5, double gau1, double gau2);
 
       bool IsValid();
 
-      LightSource(TiXmlElement* element, bool verbose);
+      LightSource(const tinyxml2::XMLElement* element, bool verbose);
       LightSource();
       ~LightSource() override;
 
-      void ParseAngle(TiXmlElement* direction, std::string angle);
+      void ParseAngle(const tinyxml2::XMLElement* direction, const std::string& angle);
 
       itkGetMacro(SpawnType, SpawnType);
 
       itkSetMacro(SpawnType, SpawnType);
 
       itkGetMacro(SpawnLocationX, double);
 
       itkSetMacro(SpawnLocationX, double);
         itkGetMacro(SpawnLocationY, double);
         itkSetMacro(SpawnLocationY, double);
         itkGetMacro(SpawnLocationZ, double);
 
         itkSetMacro(SpawnLocationZ, double);
 
         itkGetMacro(SpawnLocationXLength, double);
 
         itkSetMacro(SpawnLocationXLength, double);
         itkGetMacro(SpawnLocationYLength, double);
         itkSetMacro(SpawnLocationYLength, double);
         itkGetMacro(SpawnLocationZLength, double);
 
         itkSetMacro(SpawnLocationZLength, double);
 
         itkGetMacro(SpawnLocationRadius, double);
 
         itkSetMacro(SpawnLocationRadius, double);
         itkGetMacro(Energy, double);
         itkSetMacro(Energy, double);
         itkGetMacro(AngleXMinimum, double);
 
         itkSetMacro(AngleXMinimum, double);
 
         itkGetMacro(AngleXMaximum, double);
 
         itkSetMacro(AngleXMaximum, double);
         itkGetMacro(AngleYMinimum, double);
         itkSetMacro(AngleYMinimum, double);
         itkGetMacro(AngleYMaximum, double);
 
         itkSetMacro(AngleYMaximum, double);
 
         itkGetMacro(AngleXMode, DistributionMode);
 
         itkSetMacro(AngleXMode, DistributionMode);
         itkGetMacro(AngleYMode, DistributionMode);
         itkSetMacro(AngleYMode, DistributionMode);
         itkGetMacro(Verbose, bool);
 
         itkSetMacro(Verbose, bool);
 
     protected:
 
       const double TWO_PI = 2.0*3.14159265358979323846;
 
       SpawnType m_SpawnType;
       double m_SpawnLocationX;
       double m_SpawnLocationY;
       double m_SpawnLocationZ;
       double m_SpawnLocationXLength;
       double m_SpawnLocationYLength;
       double m_SpawnLocationZLength;
       double m_SpawnLocationRadius;
 
       double m_Energy;
 
       double m_AngleXMinimum;
       double m_AngleXMaximum;
       double m_AngleYMinimum;
       double m_AngleYMaximum;
       DistributionMode m_AngleXMode;
       DistributionMode m_AngleYMode;
 
       bool m_IsValid;
       bool m_Verbose;
 
       struct TransformResult
       {
         double z0;
         double z1;
       };
 
-      void ParsePhotonDirection(TiXmlElement* element);
-      void ParseEnergy(TiXmlElement* element);
-      void ParsePhotonSpawnArea(TiXmlElement* element);
+      void ParsePhotonDirection(const tinyxml2::XMLElement* element);
+      void ParseEnergy(const tinyxml2::XMLElement* element);
+      void ParsePhotonSpawnArea(const tinyxml2::XMLElement* element);
 
       TransformResult BoxMuellerTransform(double u1, double u2, double mu, double sigma);
     };
   }
 }
+
 #endif // MITKPHOTOACOUSTICLIGHTSOURCE_H
diff --git a/Modules/PhotoacousticsLib/include/mitkPAProbe.h b/Modules/PhotoacousticsLib/include/mitkPAProbe.h
index 711af98b47..606660046c 100644
--- a/Modules/PhotoacousticsLib/include/mitkPAProbe.h
+++ b/Modules/PhotoacousticsLib/include/mitkPAProbe.h
@@ -1,65 +1,68 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef MITKPHOTOACOUSTICPROBE_H
 #define MITKPHOTOACOUSTICPROBE_H
 
 #include <MitkPhotoacousticsLibExports.h>
 
 #include <mitkCommon.h>
 
 //Includes for smart pointer usage
 #include "mitkCommon.h"
 #include "itkLightObject.h"
 
 #include "mitkPALightSource.h"
 #include <vector>
-#include <tinyxml.h>
+
+namespace tinyxml2 {
+  class XMLDocument;
+}
 
 namespace mitk {
   namespace pa {
     /**
      * @brief The Probe class
      * The representation of a Probe
      */
     class MITKPHOTOACOUSTICSLIB_EXPORT Probe : public itk::LightObject
     {
     public:
 
       mitkClassMacroItkParent(Probe, itk::LightObject);
       mitkNewMacro2Param(Self, std::string, bool);
       mitkNewMacro2Param(Self, const char*, bool);
 
       const std::string XML_TAG_PROBE = "Probe";
       const std::string XML_TAG_LIGHT_SOURCE = "LightSource";
 
       LightSource::PhotonInformation GetNextPhoton(double rng1, double rnd2, double rnd3, double rnd4,
         double rnd5, double rnd6, double rnd7, double rnd8);
 
       bool IsValid();
 
       Probe(std::string xmlFile, bool verbose);
       Probe(const char* fileStream, bool verbose);
       ~Probe() override;
 
     protected:
 
       std::vector<LightSource::Pointer> m_LightSources;
       bool m_IsValid;
       double m_TotalEnergy;
       bool m_Verbose;
 
-      void InitProbe(TiXmlDocument document);
+      void InitProbe(const tinyxml2::XMLDocument& document);
     };
   }
 }
 #endif // MITKPHOTOACOUSTICPROBE_H
diff --git a/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPALightSource.cpp b/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPALightSource.cpp
index 5de81de1b1..f42e51dbce 100644
--- a/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPALightSource.cpp
+++ b/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPALightSource.cpp
@@ -1,410 +1,411 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPALightSource.h"
 #include <cmath>
+#include <tinyxml2.h>
 
 mitk::pa::LightSource::LightSource() :
   m_IsValid(false)
 {
 }
 
-mitk::pa::LightSource::LightSource(TiXmlElement* element, bool verbose) :
+mitk::pa::LightSource::LightSource(const tinyxml2::XMLElement* element, bool verbose) :
   m_IsValid(true),
   m_Verbose(verbose)
 {
   ParseEnergy(element);
   ParsePhotonSpawnArea(element);
   ParsePhotonDirection(element);
 
   if (m_IsValid)
   {
     if (m_Verbose)
       std::cout << "Successfully created LightSource" << std::endl;
   }
   else
   {
     if (m_Verbose)
       std::cout << "Failed creating LightSource." << std::endl;
   }
 }
 
 mitk::pa::LightSource::~LightSource()
 {
 }
 
 mitk::pa::LightSource::TransformResult mitk::pa::LightSource::BoxMuellerTransform(double u1, double u2, double mu, double sigma)
 {
   TransformResult result;
   result.z0 = sqrt(-2.0 * log(u1)) * cos(TWO_PI * u2) * sigma + mu;
   result.z1 = sqrt(-2.0 * log(u1)) * sin(TWO_PI * u2) * sigma + mu;
   return result;
 }
 
-void mitk::pa::LightSource::ParsePhotonDirection(TiXmlElement* element)
+void mitk::pa::LightSource::ParsePhotonDirection(const tinyxml2::XMLElement* element)
 {
-  TiXmlElement* direction = element->FirstChildElement(XML_TAG_PHOTON_DIRECTION);
+  auto* direction = element->FirstChildElement(XML_TAG_PHOTON_DIRECTION.c_str());
   if (direction)
   {
     ParseAngle(direction, XML_TAG_X_ANGLE);
   }
   else
   {
     if (m_Verbose)
       std::cerr << "No \"" << XML_TAG_X_ANGLE << "\" field in xml. Setting to default (0, 0, UNIFORM)." << std::endl;
 
     m_AngleXMinimum = 0;
     m_AngleXMaximum = 0;
     m_AngleXMode = DistributionMode::UNIFORM;
   }
 
-  direction = element->FirstChildElement(XML_TAG_PHOTON_DIRECTION);
+  direction = element->FirstChildElement(XML_TAG_PHOTON_DIRECTION.c_str());
   if (direction)
   {
     ParseAngle(direction, XML_TAG_Y_ANGLE);
   }
   else
   {
     if (m_Verbose)
       std::cerr << "No \"" << XML_TAG_Y_ANGLE << "\" field in xml. Setting to default (0, 0, UNIFORM)." << std::endl;
 
     m_AngleYMinimum = 0;
     m_AngleYMaximum = 0;
     m_AngleYMode = DistributionMode::UNIFORM;
   }
 }
 
-void mitk::pa::LightSource::ParseAngle(TiXmlElement* direction, std::string angle)
+void mitk::pa::LightSource::ParseAngle(const tinyxml2::XMLElement* direction, const std::string& angle)
 {
   double minimum;
   double maximum;
   DistributionMode mode = DistributionMode::GAUSSIAN;
 
   if (m_Verbose)
     std::cout << "Parsing " << angle << std::endl;
-  TiXmlElement* angleElement = direction->FirstChildElement(angle);
+  auto* angleElement = direction->FirstChildElement(angle.c_str());
   if (angleElement)
   {
-    TiXmlElement* angleMin = angleElement->FirstChildElement(XML_TAG_MINIMUM);
+    auto* angleMin = angleElement->FirstChildElement(XML_TAG_MINIMUM.c_str());
     if (angleMin)
     {
       std::string angleMinText = angleMin->GetText();
       minimum = std::stod(angleMinText);
       if (m_Verbose)
         std::cout << "Setting min=" << minimum << std::endl;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_MINIMUM << "\" tag in xml. Setting min=0" << std::endl;
       minimum = 0;
     }
 
-    TiXmlElement* angleMax = angleElement->FirstChildElement(XML_TAG_MAXIMUM);
+    auto* angleMax = angleElement->FirstChildElement(XML_TAG_MAXIMUM.c_str());
     if (angleMax)
     {
       std::string angleMaxText = angleMax->GetText();
       maximum = std::stod(angleMaxText);
       if (m_Verbose)
         std::cout << "Setting max=" << maximum << std::endl;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_MAXIMUM << "\" tag in xml. Setting max=0" << std::endl;
       maximum = 0;
     }
 
-    TiXmlElement* angleMode = angleElement->FirstChildElement(XML_TAG_MODE);
+    auto* angleMode = angleElement->FirstChildElement(XML_TAG_MODE.c_str());
     if (angleMode)
     {
       std::string angleModeText = angleMode->GetText();
       if (strcmp("UNIFORM", angleModeText.c_str()) == 0)
       {
         mode = DistributionMode::UNIFORM;
         if (m_Verbose)
           std::cout << "Setting mode=UNIFORM" << std::endl;
       }
       else if (strcmp("GAUSSIAN", angleModeText.c_str()) == 0)
       {
         mode = DistributionMode::GAUSSIAN;
         if (m_Verbose)
           std::cout << "Setting mode=GAUSSIAN" << std::endl;
       }
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_MODE << "\" tag in xml. Setting mode=UNIFORM" << std::endl;
       mode = DistributionMode::UNIFORM;
     }
   }
   else
   {
     if (m_Verbose)
       std::cerr << "No \"" << angle << "\" field in xml. Setting to default (0, 0, UNIFORM)." << std::endl;
 
     maximum = 0;
     minimum = 0;
     mode = DistributionMode::UNIFORM;
   }
 
   if (strcmp(XML_TAG_X_ANGLE.c_str(), angle.c_str()) == 0)
   {
     m_AngleXMinimum = minimum;
     m_AngleXMaximum = maximum;
     m_AngleXMode = mode;
   }
   else if (strcmp(XML_TAG_Y_ANGLE.c_str(), angle.c_str()) == 0)
   {
     m_AngleYMinimum = minimum;
     m_AngleYMaximum = maximum;
     m_AngleYMode = mode;
   }
 }
 
-void mitk::pa::LightSource::ParseEnergy(TiXmlElement* element)
+void mitk::pa::LightSource::ParseEnergy(const tinyxml2::XMLElement* element)
 {
-  TiXmlElement* energy = element->FirstChildElement(XML_TAG_ENERGY);
+  auto* energy = element->FirstChildElement(XML_TAG_ENERGY.c_str());
   if (energy)
   {
     std::string energyText = energy->GetText();
     m_Energy = std::stod(energyText);
     if (m_Verbose)
       std::cout << "Setting energy=" << m_Energy;
   }
   else
   {
     if (m_Verbose)
       std::cerr << "No \"" << XML_TAG_ENERGY << "\" field in xml. Setting Energy=1" << std::endl;
     m_Energy = 1.0;
   }
 }
 
-void mitk::pa::LightSource::ParsePhotonSpawnArea(TiXmlElement* element)
+void mitk::pa::LightSource::ParsePhotonSpawnArea(const tinyxml2::XMLElement* element)
 {
-  TiXmlElement* spawnArea = element->FirstChildElement("PhotonSpawnArea");
+  auto* spawnArea = element->FirstChildElement("PhotonSpawnArea");
   if (spawnArea)
   {
-    TiXmlElement* spawnType = spawnArea->FirstChildElement(XML_TAG_SPAWN_TYPE);
+    auto* spawnType = spawnArea->FirstChildElement(XML_TAG_SPAWN_TYPE.c_str());
     if (spawnType)
     {
       std::string spawnTypeText = spawnType->GetText();
       if (strcmp(XML_TAG_SPAWN_TYPE_POINT.c_str(), spawnTypeText.c_str()) == 0)
       {
         m_SpawnType = SpawnType::POINT;
         if (m_Verbose)
           std::cout << "Setting " << XML_TAG_SPAWN_TYPE << " = " << XML_TAG_SPAWN_TYPE_POINT << std::endl;
       }
       else if (strcmp(XML_TAG_SPAWN_TYPE_RECTANGLE.c_str(), spawnTypeText.c_str()) == 0)
       {
         m_SpawnType = SpawnType::RECTANGLE;
         if (m_Verbose)
           std::cout << "Setting " << XML_TAG_SPAWN_TYPE << " = " << XML_TAG_SPAWN_TYPE_RECTANGLE << std::endl;
       }
       else if (strcmp(XML_TAG_SPAWN_TYPE_CIRCLE.c_str(), spawnTypeText.c_str()) == 0)
       {
         m_SpawnType = SpawnType::CIRCLE;
         if (m_Verbose)
           std::cout << "Setting " << XML_TAG_SPAWN_TYPE << " = " << XML_TAG_SPAWN_TYPE_CIRCLE << std::endl;
       }
       else
       {
         std::cerr << "The provided SpawnType (" << spawnTypeText << ") did not match any available spawn type. Light source is not valid." << std::endl;
         m_IsValid = false;
       }
     }
     else
     {
       std::cerr << "The \"" << XML_TAG_SPAWN_TYPE << "\" element was not provided for this light source. Light source is not valid." << std::endl;
       m_IsValid = false;
     }
 
-    TiXmlElement* xLocation = spawnArea->FirstChildElement(XML_TAG_X);
+    auto* xLocation = spawnArea->FirstChildElement(XML_TAG_X.c_str());
     if (xLocation)
     {
       std::string xLocationText = xLocation->GetText();
       m_SpawnLocationX = std::stod(xLocationText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_X << "=" << m_SpawnLocationX;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_X << "\" field in xml. Setting " << XML_TAG_X << "=0" << std::endl;
       m_SpawnLocationX = 0;
     }
 
-    TiXmlElement* yLocation = spawnArea->FirstChildElement(XML_TAG_Y);
+    auto* yLocation = spawnArea->FirstChildElement(XML_TAG_Y.c_str());
     if (yLocation)
     {
       std::string yLocationText = yLocation->GetText();
       m_SpawnLocationY = std::stod(yLocationText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_Y << "=" << m_SpawnLocationY;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_Y << "\" field in xml. Setting " << XML_TAG_Y << "=0" << std::endl;
       m_SpawnLocationY = 0;
     }
 
-    TiXmlElement* zLocation = spawnArea->FirstChildElement(XML_TAG_Z);
+    auto* zLocation = spawnArea->FirstChildElement(XML_TAG_Z.c_str());
     if (zLocation)
     {
       std::string zLocationText = zLocation->GetText();
       m_SpawnLocationZ = std::stod(zLocationText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_Z << "=" << m_SpawnLocationZ;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_Z << "\" field in xml. Setting " << XML_TAG_Z << "=0.1" << std::endl;
       m_SpawnLocationZ = 0.1;
     }
 
-    TiXmlElement* rLocation = spawnArea->FirstChildElement(XML_TAG_R);
+    auto* rLocation = spawnArea->FirstChildElement(XML_TAG_R.c_str());
     if (rLocation)
     {
       std::string rLocationText = rLocation->GetText();
       m_SpawnLocationRadius = std::stod(rLocationText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_R << "=" << m_SpawnLocationRadius;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_R << "\" field in xml. Setting " << XML_TAG_R << "=0" << std::endl;
       m_SpawnLocationRadius = 0;
     }
 
-    TiXmlElement* xLength = spawnArea->FirstChildElement(XML_TAG_X_LENGTH);
+    auto* xLength = spawnArea->FirstChildElement(XML_TAG_X_LENGTH.c_str());
     if (xLength)
     {
       std::string xLengthText = xLength->GetText();
       m_SpawnLocationXLength = std::stod(xLengthText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_X_LENGTH << "=" << m_SpawnLocationXLength << std::endl;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_X_LENGTH << "\" field in xml. Setting " << XML_TAG_X_LENGTH << "=0" << std::endl;
       m_SpawnLocationXLength = 0;
     }
 
-    TiXmlElement* yLength = spawnArea->FirstChildElement(XML_TAG_Y_LENGTH);
+    auto* yLength = spawnArea->FirstChildElement(XML_TAG_Y_LENGTH.c_str());
     if (yLength)
     {
       std::string yLengthText = yLength->GetText();
       m_SpawnLocationYLength = std::stod(yLengthText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_Y_LENGTH << "=" << m_SpawnLocationYLength << std::endl;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_Y_LENGTH << "\" field in xml. Setting " << XML_TAG_Y_LENGTH << "=0" << std::endl;
       m_SpawnLocationYLength = 0;
     }
 
-    TiXmlElement* zLength = spawnArea->FirstChildElement(XML_TAG_Z_LENGTH);
+    auto* zLength = spawnArea->FirstChildElement(XML_TAG_Z_LENGTH.c_str());
     if (zLength)
     {
       std::string zLengthText = zLength->GetText();
       m_SpawnLocationZLength = std::stod(zLengthText);
       if (m_Verbose)
         std::cout << "Setting " << XML_TAG_Z_LENGTH << "=" << m_SpawnLocationZLength << std::endl;
     }
     else
     {
       if (m_Verbose)
         std::cerr << "No \"" << XML_TAG_Z_LENGTH << "\" field in xml. Setting " << XML_TAG_Z_LENGTH << "=0" << std::endl;
       m_SpawnLocationZLength = 0;
     }
   }
   else
     m_IsValid = false;
 }
 
 mitk::pa::LightSource::PhotonInformation mitk::pa::LightSource::GetNextPhoton(double rnd1, double rnd2, double rnd3,
   double rnd4, double rnd5, double gau1, double gau2)
 {
   PhotonInformation returnValue;
 
   switch (m_SpawnType)
   {
   case POINT:
     returnValue.xPosition = m_SpawnLocationX;
     returnValue.yPosition = m_SpawnLocationY;
     returnValue.zPosition = m_SpawnLocationZ;
     break;
   case RECTANGLE:
     returnValue.xPosition = m_SpawnLocationX + rnd3 * m_SpawnLocationXLength;
     returnValue.yPosition = m_SpawnLocationY + rnd4 * m_SpawnLocationYLength;
     returnValue.zPosition = m_SpawnLocationZ + rnd5 * m_SpawnLocationZLength;
     break;
   case CIRCLE:
     double radius = rnd3 * m_SpawnLocationRadius;
     double angle = rnd4 * TWO_PI;
 
     returnValue.xPosition = m_SpawnLocationX + radius * cos(angle);
     returnValue.yPosition = m_SpawnLocationY + radius * sin(angle);
     returnValue.zPosition = m_SpawnLocationZ;
     break;
   }
 
   switch (m_AngleXMode)
   {
   case UNIFORM:
     returnValue.xAngle = rnd1 * (m_AngleXMaximum - m_AngleXMinimum) + m_AngleXMinimum;
     break;
   case GAUSSIAN:
     TransformResult trans = BoxMuellerTransform(gau1, gau2, (m_AngleXMaximum - m_AngleXMinimum) / 2 + m_AngleXMinimum, (m_AngleXMaximum - m_AngleXMinimum) / 2.355);
     returnValue.xAngle = trans.z0;
     break;
   }
 
   switch (m_AngleYMode)
   {
   case UNIFORM:
     returnValue.yAngle = rnd2 * (m_AngleYMaximum - m_AngleYMinimum) + m_AngleYMinimum;
     break;
   case GAUSSIAN:
     TransformResult trans = BoxMuellerTransform(gau1, gau2, (m_AngleYMaximum - m_AngleYMinimum) / 2 + m_AngleYMinimum, (m_AngleYMaximum - m_AngleYMinimum) / 2.355);
     returnValue.yAngle = trans.z1;
     break;
   }
 
   if ((returnValue.xAngle*returnValue.xAngle + returnValue.yAngle*returnValue.yAngle) > 1)
   {
     double unify = sqrt(returnValue.xAngle*returnValue.xAngle + returnValue.yAngle*returnValue.yAngle)*1.001;
     returnValue.xAngle = returnValue.xAngle / unify;
     returnValue.yAngle = returnValue.yAngle / unify;
   }
 
   returnValue.zAngle = sqrt(1 - returnValue.xAngle*returnValue.xAngle - returnValue.yAngle*returnValue.yAngle);
 
   if (m_Verbose)
     std::cout << "Created a new photon at (" << returnValue.xPosition << "|" << returnValue.yPosition << "|" <<
     returnValue.zPosition << ") with angle (" << returnValue.xAngle << "|" << returnValue.yAngle << "|" <<
     returnValue.zAngle << ")" << std::endl;
 
   return returnValue;
 }
 
 bool mitk::pa::LightSource::IsValid()
 {
   return m_IsValid;
 }
diff --git a/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPAProbe.cpp b/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPAProbe.cpp
index 3293dbdce5..1f1884b4d8 100644
--- a/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPAProbe.cpp
+++ b/Modules/PhotoacousticsLib/src/Utils/ProbeDesign/mitkPAProbe.cpp
@@ -1,129 +1,130 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPAProbe.h"
+#include <tinyxml2.h>
 
 mitk::pa::Probe::Probe(std::string file, bool verbose) :
   m_TotalEnergy(0),
   m_Verbose(verbose)
 {
-  TiXmlDocument xmlDoc(file);
-  bool success = xmlDoc.LoadFile(TIXML_ENCODING_UTF8);
+  tinyxml2::XMLDocument xmlDoc;
+  bool success = xmlDoc.LoadFile(file.c_str()) == tinyxml2::XML_SUCCESS;
   if (m_Verbose)
   {
     std::cout << "reading of document was " << (success ? "" : "not ") << "successful" << std::endl;
     std::cout << "Content of the Xml file:" << std::endl;
     xmlDoc.Print();
   }
   if (success)
   {
     InitProbe(xmlDoc);
   }
   else
   {
     if (m_Verbose)
     {
       std::cerr << "Could not load xml file" << std::endl;
     }
   }
 }
 
 mitk::pa::Probe::Probe(const char* fileStream, bool verbose) :
   m_TotalEnergy(0),
   m_Verbose(verbose)
 {
-  TiXmlDocument xmlDoc;
-  const char* success = xmlDoc.Parse(fileStream, nullptr, TIXML_ENCODING_UTF8);
+  tinyxml2::XMLDocument xmlDoc;
+  auto success = xmlDoc.Parse(fileStream);
   if (m_Verbose)
   {
-    std::cout << "reading document was " << (success == nullptr ? "" : "not ") << "successful (" << (success == nullptr ? "NULL" : success) << ")" << std::endl;
+    std::cout << "reading document was " << (success == tinyxml2::XML_SUCCESS ? "" : "not ") << "successful" << std::endl;
     std::cout << "Content of the Xml file:" << std::endl;
     xmlDoc.Print();
   }
-  if (success == nullptr || atoi(success) == 0)
+  if (success == tinyxml2::XML_SUCCESS)
   {
     InitProbe(xmlDoc);
   }
   else
   {
     if (m_Verbose)
     {
       std::cerr << "Could not load xml file" << std::endl;
     }
   }
 }
 
 mitk::pa::Probe::~Probe()
 {
 }
 
 mitk::pa::LightSource::PhotonInformation mitk::pa::Probe::GetNextPhoton(double rng1, double rnd2,
   double rnd3, double rnd4, double rnd5,
   double rnd6, double rnd7, double rnd8)
 {
   rng1 = rng1*m_TotalEnergy;
   double currentEnergy = 0;
   for (LightSource::Pointer lightSource : m_LightSources)
   {
     currentEnergy += lightSource->GetEnergy();
     if (currentEnergy >= rng1)
       return lightSource->GetNextPhoton(rnd2, rnd3, rnd4, rnd5, rnd6, rnd7, rnd8);
   }
 
   //Last resort: If something goes wrong, return a position from the first source.
   return m_LightSources[0]->GetNextPhoton(rnd2, rnd3, rnd4, rnd5, rnd6, rnd7, rnd8);
 }
 
 bool mitk::pa::Probe::IsValid()
 {
   return m_IsValid;
 }
 
-void mitk::pa::Probe::InitProbe(TiXmlDocument xmlDoc)
+void mitk::pa::Probe::InitProbe(const tinyxml2::XMLDocument& xmlDoc)
 {
   m_IsValid = true;
 
-  TiXmlElement* root = xmlDoc.FirstChildElement(XML_TAG_PROBE);
+  auto* root = xmlDoc.FirstChildElement(XML_TAG_PROBE.c_str());
   if (root)
   {
-    for (TiXmlElement* element = root->FirstChildElement(XML_TAG_LIGHT_SOURCE);
-      element != nullptr; element = element->NextSiblingElement(XML_TAG_LIGHT_SOURCE))
+    for (auto* element = root->FirstChildElement(XML_TAG_LIGHT_SOURCE.c_str());
+      element != nullptr; element = element->NextSiblingElement(XML_TAG_LIGHT_SOURCE.c_str()))
     {
       LightSource::Pointer lightSource = LightSource::New(element, m_Verbose);
       if (lightSource.IsNotNull() && lightSource->IsValid())
       {
         m_LightSources.push_back(lightSource);
         m_TotalEnergy += lightSource->GetEnergy();
       }
       else
       {
         m_IsValid = false;
       }
     }
   }
   else
   {
     m_IsValid = false;
   }
 
   if (!m_IsValid)
   {
     std::cerr << "Creation of a valid Photoacoustic Probe failed." << std::endl;
   }
   else
   {
     if (m_Verbose)
     {
       std::cout << "Successfully created Photoacoustic Probe." << std::endl;
     }
   }
 }
diff --git a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.cpp b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.cpp
index 246a8c2843..8407bb074e 100644
--- a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.cpp
+++ b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.cpp
@@ -1,560 +1,562 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include <mitkPlanarFigureIO.h>
 
 #include "mitkCustomMimeType.h"
 #include "mitkIOMimeTypes.h"
 #include "mitkExceptionMacro.h"
 
 #include "mitkPlanarAngle.h"
 #include "mitkPlanarArrow.h"
 #include "mitkPlanarBezierCurve.h"
 #include "mitkPlanarCircle.h"
 #include "mitkPlanarCross.h"
 #include "mitkPlanarDoubleEllipse.h"
 #include "mitkPlanarEllipse.h"
 #include "mitkPlanarFourPointAngle.h"
 #include "mitkPlanarLine.h"
 #include "mitkPlanarPolygon.h"
 #include "mitkPlanarRectangle.h"
 #include "mitkPlanarSubdivisionPolygon.h"
 #include "mitkPlaneGeometry.h"
 
 #include "mitkBasePropertySerializer.h"
 
 #include <mitkLocaleSwitch.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
 
   PlanarFigureIO::PlanarFigureIO()
     : AbstractFileIO(PlanarFigure::GetStaticNameOfClass())
   {
     std::string category = "MITK PlanarFigure File";
     CustomMimeType customMimeType;
     customMimeType.SetCategory(category);
     customMimeType.AddExtension("pf");
     this->AbstractFileIOWriter::SetMimeType(customMimeType);
     this->AbstractFileIOWriter::SetDescription(category);
 
     customMimeType.AddExtension("pf");
     customMimeType.AddExtension("PF");
     this->AbstractFileIOReader::SetMimeType(customMimeType);
     this->AbstractFileIOReader::SetDescription(category);
 
     AbstractFileWriter::SetRanking(10);
     AbstractFileReader::SetRanking(10);
     this->RegisterService();
   }
 
   IFileIO::ConfidenceLevel PlanarFigureIO::GetWriterConfidenceLevel() const
   {
     if (AbstractFileIO::GetWriterConfidenceLevel() == Unsupported)
       return Unsupported;
 
     const auto *input = static_cast<const PlanarFigure *>(this->GetInput());
     if (input != nullptr)
       return Supported;
     else
       return Unsupported;
   }
 
   void PlanarFigureIO::Write()
   {
     this->ValidateOutputLocation();
 
     mitk::LocaleSwitch localeSwitch("C");
 
-    TiXmlDocument document;
-    auto decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc....
-    document.LinkEndChild(decl);
+    tinyxml2::XMLDocument document;
+    document.InsertEndChild(document.NewDeclaration());
 
-    auto version = new TiXmlElement("Version");
+    auto *version = document.NewElement("Version");
     version->SetAttribute("Writer", __FILE__);
     version->SetAttribute("CVSRevision", "$Revision: 17055 $");
     version->SetAttribute("FileVersion", 1);
-    document.LinkEndChild(version);
+    document.InsertEndChild(version);
 
     auto pf = dynamic_cast<const PlanarFigure*>(this->GetInput());
     if (pf == nullptr)
     {
       mitkThrow() << "Try to safe a BaseData instance as PlanarFigure. That is not a planar figure. This should not happen and is a violated precondition. Please check the program logic.";
     }
 
-    auto pfElement = new TiXmlElement("PlanarFigure");
+    auto *pfElement = document.NewElement("PlanarFigure");
     pfElement->SetAttribute("type", pf->GetNameOfClass());
-    document.LinkEndChild(pfElement);
+    document.InsertEndChild(pfElement);
 
     // Serialize property list of PlanarFigure
     mitk::PropertyList::Pointer propertyList = pf->GetPropertyList();
     mitk::PropertyList::PropertyMap::const_iterator it;
     for (it = propertyList->GetMap()->begin(); it != propertyList->GetMap()->end(); ++it)
     {
       // Create seralizer for this property
       const mitk::BaseProperty* prop = it->second;
       std::string serializerName = std::string(prop->GetNameOfClass()) + "Serializer";
       std::list<itk::LightObject::Pointer> allSerializers =
         itk::ObjectFactoryBase::CreateAllInstance(serializerName.c_str());
 
       if (allSerializers.size() != 1)
       {
         // No or too many serializer(s) found, skip this property
         continue;
       }
 
       auto* serializer =
         dynamic_cast<mitk::BasePropertySerializer*>(allSerializers.begin()->GetPointer());
       if (serializer == nullptr)
       {
         // Serializer not valid; skip this property
       }
 
-      auto keyElement = new TiXmlElement("property");
-      keyElement->SetAttribute("key", it->first);
+      auto *keyElement = document.NewElement("property");
+      keyElement->SetAttribute("key", it->first.c_str());
       keyElement->SetAttribute("type", prop->GetNameOfClass());
 
       serializer->SetProperty(prop);
-      TiXmlElement* valueElement = nullptr;
+      tinyxml2::XMLElement* valueElement = nullptr;
       try
       {
-        valueElement = serializer->Serialize();
+        valueElement = serializer->Serialize(document);
       }
       catch (...)
       {
       }
 
       if (valueElement == nullptr)
       {
         // Serialization failed; skip this property
         continue;
       }
 
       // Add value to property element
-      keyElement->LinkEndChild(valueElement);
+      keyElement->InsertEndChild(valueElement);
 
       // Append serialized property to property list
-      pfElement->LinkEndChild(keyElement);
+      pfElement->InsertEndChild(keyElement);
     }
 
     // Serialize control points of PlanarFigure
-    auto controlPointsElement = new TiXmlElement("ControlPoints");
-    pfElement->LinkEndChild(controlPointsElement);
+    auto *controlPointsElement = document.NewElement("ControlPoints");
+    pfElement->InsertEndChild(controlPointsElement);
     for (unsigned int i = 0; i < pf->GetNumberOfControlPoints(); i++)
     {
-      auto vElement = new TiXmlElement("Vertex");
+      auto *vElement = document.NewElement("Vertex");
       vElement->SetAttribute("id", i);
-      vElement->SetDoubleAttribute("x", pf->GetControlPoint(i)[0]);
-      vElement->SetDoubleAttribute("y", pf->GetControlPoint(i)[1]);
-      controlPointsElement->LinkEndChild(vElement);
+      vElement->SetAttribute("x", pf->GetControlPoint(i)[0]);
+      vElement->SetAttribute("y", pf->GetControlPoint(i)[1]);
+      controlPointsElement->InsertEndChild(vElement);
     }
-    auto geoElement = new TiXmlElement("Geometry");
+    auto *geoElement = document.NewElement("Geometry");
     const auto* planeGeo = dynamic_cast<const PlaneGeometry*>(pf->GetPlaneGeometry());
     if (planeGeo != nullptr)
     {
       // Write parameters of IndexToWorldTransform of the PlaneGeometry
       typedef mitk::Geometry3D::TransformType TransformType;
       const TransformType* affineGeometry = planeGeo->GetIndexToWorldTransform();
       const TransformType::ParametersType& parameters = affineGeometry->GetParameters();
-      auto vElement = new TiXmlElement("transformParam");
+      auto *vElement = document.NewElement("transformParam");
       for (unsigned int i = 0; i < affineGeometry->GetNumberOfParameters(); ++i)
       {
         std::stringstream paramName;
         paramName << "param" << i;
-        vElement->SetDoubleAttribute(paramName.str().c_str(), parameters.GetElement(i));
+        vElement->SetAttribute(paramName.str().c_str(), parameters.GetElement(i));
       }
-      geoElement->LinkEndChild(vElement);
+      geoElement->InsertEndChild(vElement);
 
       // Write bounds of the PlaneGeometry
       typedef mitk::Geometry3D::BoundsArrayType BoundsArrayType;
       const BoundsArrayType& bounds = planeGeo->GetBounds();
-      vElement = new TiXmlElement("boundsParam");
+      vElement = document.NewElement("boundsParam");
       for (unsigned int i = 0; i < 6; ++i)
       {
         std::stringstream boundName;
         boundName << "bound" << i;
-        vElement->SetDoubleAttribute(boundName.str().c_str(), bounds.GetElement(i));
+        vElement->SetAttribute(boundName.str().c_str(), bounds.GetElement(i));
       }
-      geoElement->LinkEndChild(vElement);
+      geoElement->InsertEndChild(vElement);
 
       // Write spacing and origin of the PlaneGeometry
       Vector3D spacing = planeGeo->GetSpacing();
       Point3D origin = planeGeo->GetOrigin();
-      geoElement->LinkEndChild(this->CreateXMLVectorElement("Spacing", spacing));
-      geoElement->LinkEndChild(this->CreateXMLVectorElement("Origin", origin));
+      geoElement->InsertEndChild(this->CreateXMLVectorElement(document, "Spacing", spacing));
+      geoElement->InsertEndChild(this->CreateXMLVectorElement(document, "Origin", origin));
 
-      pfElement->LinkEndChild(geoElement);
+      pfElement->InsertEndChild(geoElement);
     }
 
     if (this->GetOutputStream() != nullptr)
     {
-      *(this->GetOutputStream()) << document;
+      tinyxml2::XMLPrinter printer;
+      document.Print(&printer);
+      *(this->GetOutputStream()) << printer.CStr();
     }
     else
     {
-      if (document.SaveFile(this->GetOutputLocation()) == false)
+      if (document.SaveFile(this->GetOutputLocation().c_str()) != tinyxml2::XML_SUCCESS)
       {
-        MITK_ERROR << "Could not write planar figures to " << this->GetOutputLocation() << "\nTinyXML reports '" << document.ErrorDesc()
+        MITK_ERROR << "Could not write planar figures to " << this->GetOutputLocation() << "\nTinyXML reports '" << document.ErrorStr()
           << "'";
         throw std::ios_base::failure("Error during writing of planar figure xml file.");
       }
     }
   }
 
-  TiXmlElement* mitk::PlanarFigureIO::CreateXMLVectorElement(const char* name, itk::FixedArray<mitk::ScalarType, 3> v)
+  tinyxml2::XMLElement* mitk::PlanarFigureIO::CreateXMLVectorElement(tinyxml2::XMLDocument& doc, const char* name, itk::FixedArray<mitk::ScalarType, 3> v)
   {
-    auto vElement = new TiXmlElement(name);
-    vElement->SetDoubleAttribute("x", v.GetElement(0));
-    vElement->SetDoubleAttribute("y", v.GetElement(1));
-    vElement->SetDoubleAttribute("z", v.GetElement(2));
+    auto vElement = doc.NewElement(name);
+    vElement->SetAttribute("x", v.GetElement(0));
+    vElement->SetAttribute("y", v.GetElement(1));
+    vElement->SetAttribute("z", v.GetElement(2));
     return vElement;
   }
 
   IFileIO::ConfidenceLevel PlanarFigureIO::GetReaderConfidenceLevel() const
   {
     if (AbstractFileIO::GetReaderConfidenceLevel() == Unsupported)
       return Unsupported;
 
     return Supported;
     //Remark: The original reader code assumed that al pf files can be read.
     //So no content checking was done. Thus was not implemented while refactoring
     //to services yet. But I think it would make sense.
   }
 
   std::vector<BaseData::Pointer> PlanarFigureIO::DoRead()
   {
     mitk::LocaleSwitch localeSwitch("C");
 
     std::vector<BaseData::Pointer> results;
 
-    TiXmlDocument document;
+    tinyxml2::XMLDocument document;
 
     if (this->GetInputStream() != nullptr)
     {
       std::string s(std::istreambuf_iterator<char>(*(this->GetInputStream())), {});
       document.Parse(s.c_str());
       //Remark: didn't use *(this->GetInputStream()) >> document;
       //because our PlanarFigure files version 1 are illformed (multiple top level elements)
       //and therefor tinyxml does not read them completly when streamed directly.
       //only the first (version element) is read.
     }
     else
     {
-      if (!document.LoadFile(this->GetInputLocation()))
+      if (tinyxml2::XML_SUCCESS != document.LoadFile(this->GetInputLocation().c_str()))
       {
-        MITK_ERROR << "Could not open/read/parse " << this->GetInputLocation() << ". TinyXML reports: '" << document.ErrorDesc()
-          << "'. "
-          << "The error occurred in row " << document.ErrorRow() << ", column " << document.ErrorCol() << ".";
+        MITK_ERROR << "Could not open/read/parse " << this->GetInputLocation() << ". TinyXML reports: '" << document.ErrorStr() << "'.";
         return {};
       }
     }
 
     int fileVersion = 1;
-    TiXmlElement* versionObject = document.FirstChildElement("Version");
+    auto* versionObject = document.FirstChildElement("Version");
     if (versionObject != nullptr)
     {
-      if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != TIXML_SUCCESS)
+      if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != tinyxml2::XML_SUCCESS)
       {
         MITK_WARN << this->GetInputLocation() << " does not contain version information! Trying version 1 format." << std::endl;
       }
     }
     else
     {
       MITK_WARN << this->GetInputLocation() << " does not contain version information! Trying version 1 format." << std::endl;
     }
     if (fileVersion !=
       1) // add file version selection and version specific file parsing here, if newer file versions are created
     {
       MITK_WARN << "File version > 1 is not supported by this reader.";
       return {};
     }
 
     /* file version 1 reader code */
-    for (TiXmlElement* pfElement = document.FirstChildElement("PlanarFigure"); pfElement != nullptr;
+    for (auto* pfElement = document.FirstChildElement("PlanarFigure"); pfElement != nullptr;
       pfElement = pfElement->NextSiblingElement("PlanarFigure"))
     {
-      std::string type = pfElement->Attribute("type");
+      const char* typeC = pfElement->Attribute("type");
+      std::string type = nullptr != typeC
+        ? typeC
+        : "";
 
       mitk::PlanarFigure::Pointer planarFigure = nullptr;
       if (type == "PlanarAngle")
       {
         planarFigure = mitk::PlanarAngle::New();
       }
       else if (type == "PlanarCircle")
       {
         planarFigure = mitk::PlanarCircle::New();
       }
       else if (type == "PlanarEllipse")
       {
         planarFigure = mitk::PlanarEllipse::New();
       }
       else if (type == "PlanarCross")
       {
         planarFigure = mitk::PlanarCross::New();
       }
       else if (type == "PlanarFourPointAngle")
       {
         planarFigure = mitk::PlanarFourPointAngle::New();
       }
       else if (type == "PlanarLine")
       {
         planarFigure = mitk::PlanarLine::New();
       }
       else if (type == "PlanarPolygon")
       {
         planarFigure = mitk::PlanarPolygon::New();
       }
       else if (type == "PlanarSubdivisionPolygon")
       {
         planarFigure = mitk::PlanarSubdivisionPolygon::New();
       }
       else if (type == "PlanarRectangle")
       {
         planarFigure = mitk::PlanarRectangle::New();
       }
       else if (type == "PlanarArrow")
       {
         planarFigure = mitk::PlanarArrow::New();
       }
       else if (type == "PlanarDoubleEllipse")
       {
         planarFigure = mitk::PlanarDoubleEllipse::New();
       }
       else if (type == "PlanarBezierCurve")
       {
         planarFigure = mitk::PlanarBezierCurve::New();
       }
       else
       {
         // unknown type
         MITK_WARN << "encountered unknown planar figure type '" << type << "'. Skipping this element.";
         continue;
       }
 
       // Read properties of the planar figure
-      for (TiXmlElement* propertyElement = pfElement->FirstChildElement("property"); propertyElement != nullptr;
+      for (auto* propertyElement = pfElement->FirstChildElement("property"); propertyElement != nullptr;
         propertyElement = propertyElement->NextSiblingElement("property"))
       {
         const char* keya = propertyElement->Attribute("key");
         const std::string key(keya ? keya : "");
 
         const char* typea = propertyElement->Attribute("type");
         const std::string type(typea ? typea : "");
 
         // hand propertyElement to specific reader
         std::stringstream propertyDeserializerClassName;
         propertyDeserializerClassName << type << "Serializer";
 
         const std::list<itk::LightObject::Pointer> readers =
           itk::ObjectFactoryBase::CreateAllInstance(propertyDeserializerClassName.str().c_str());
         if (readers.size() < 1)
         {
           MITK_ERROR << "No property reader found for " << type;
         }
         if (readers.size() > 1)
         {
           MITK_WARN << "Multiple property readers found for " << type << ". Using arbitrary first one.";
         }
 
         for (auto iter = readers.cbegin(); iter != readers.cend(); ++iter)
         {
           if (auto* reader = dynamic_cast<BasePropertySerializer*>(iter->GetPointer()))
           {
             const BaseProperty::Pointer property = reader->Deserialize(propertyElement->FirstChildElement());
             if (property.IsNotNull())
             {
               planarFigure->GetPropertyList()->ReplaceProperty(key, property);
             }
             else
             {
               MITK_ERROR << "There were errors while loading property '" << key << "' of type " << type
                 << ". Your data may be corrupted";
             }
             break;
           }
         }
       }
 
       // If we load a planarFigure, it has definitely been placed correctly.
       // If we do not set this property here, we cannot load old planarFigures
       // without messing up the interaction (PF-Interactor needs this property.
       planarFigure->GetPropertyList()->SetBoolProperty("initiallyplaced", true);
 
       // Which features (length or circumference etc) a figure has is decided by whether it is closed or not
       // the function SetClosed has to be called in case of PlanarPolygons to ensure they hold the correct feature
       auto* planarPolygon = dynamic_cast<PlanarPolygon*>(planarFigure.GetPointer());
       if (planarPolygon != nullptr)
       {
         bool isClosed = false;
         planarFigure->GetPropertyList()->GetBoolProperty("closed", isClosed);
         planarPolygon->SetClosed(isClosed);
       }
 
       // Read geometry of containing plane
-      TiXmlElement* geoElement = pfElement->FirstChildElement("Geometry");
+      auto* geoElement = pfElement->FirstChildElement("Geometry");
       if (geoElement != nullptr)
       {
         try
         {
           // Create plane geometry
           mitk::PlaneGeometry::Pointer planeGeo = mitk::PlaneGeometry::New();
 
           // Extract and set plane transform parameters
           const DoubleList transformList =
             this->GetDoubleAttributeListFromXMLNode(geoElement->FirstChildElement("transformParam"), "param", 12);
 
           typedef mitk::BaseGeometry::TransformType TransformType;
           TransformType::ParametersType parameters;
           parameters.SetSize(12);
 
           unsigned int i;
           DoubleList::const_iterator it;
           for (it = transformList.cbegin(), i = 0; it != transformList.cend(); ++it, ++i)
           {
             parameters.SetElement(i, *it);
           }
 
           typedef mitk::BaseGeometry::TransformType TransformType;
           TransformType::Pointer affineGeometry = TransformType::New();
           affineGeometry->SetParameters(parameters);
           planeGeo->SetIndexToWorldTransform(affineGeometry);
 
           // Extract and set plane bounds
           const DoubleList boundsList =
             this->GetDoubleAttributeListFromXMLNode(geoElement->FirstChildElement("boundsParam"), "bound", 6);
 
           typedef mitk::BaseGeometry::BoundsArrayType BoundsArrayType;
 
           BoundsArrayType bounds;
           for (it = boundsList.cbegin(), i = 0; it != boundsList.cend(); ++it, ++i)
           {
             bounds[i] = *it;
           }
 
           planeGeo->SetBounds(bounds);
 
           // Extract and set spacing and origin
           const Vector3D spacing = this->GetVectorFromXMLNode(geoElement->FirstChildElement("Spacing"));
           planeGeo->SetSpacing(spacing);
 
           const Point3D origin = this->GetPointFromXMLNode(geoElement->FirstChildElement("Origin"));
           planeGeo->SetOrigin(origin);
           planarFigure->SetPlaneGeometry(planeGeo);
         }
         catch (...)
         {
         }
       }
-      TiXmlElement* cpElement = pfElement->FirstChildElement("ControlPoints");
+      auto* cpElement = pfElement->FirstChildElement("ControlPoints");
       bool first = true;
       if (cpElement != nullptr)
-        for (TiXmlElement* vertElement = cpElement->FirstChildElement("Vertex"); vertElement != nullptr;
+        for (auto* vertElement = cpElement->FirstChildElement("Vertex"); vertElement != nullptr;
           vertElement = vertElement->NextSiblingElement("Vertex"))
       {
         int id = 0;
         mitk::Point2D::ValueType x = 0.0;
         mitk::Point2D::ValueType y = 0.0;
-        if (vertElement->QueryIntAttribute("id", &id) == TIXML_WRONG_TYPE)
+        if (vertElement->QueryIntAttribute("id", &id) != tinyxml2::XML_SUCCESS)
           return{}; // TODO: can we do a better error handling?
-        if (vertElement->QueryDoubleAttribute("x", &x) == TIXML_WRONG_TYPE)
+        if (vertElement->QueryDoubleAttribute("x", &x) != tinyxml2::XML_SUCCESS)
           return{}; // TODO: can we do a better error handling?
-        if (vertElement->QueryDoubleAttribute("y", &y) == TIXML_WRONG_TYPE)
+        if (vertElement->QueryDoubleAttribute("y", &y) != tinyxml2::XML_SUCCESS)
           return{}; // TODO: can we do a better error handling?
         Point2D p;
         p.SetElement(0, x);
         p.SetElement(1, y);
         if (first == true) // needed to set m_FigurePlaced to true
         {
           planarFigure->PlaceFigure(p);
           first = false;
         }
         planarFigure->SetControlPoint(id, p, true);
       }
 
       // Calculate feature quantities of this PlanarFigure
       planarFigure->EvaluateFeatures();
 
       // Make sure that no control point is currently selected
       planarFigure->DeselectControlPoint();
 
       if (planarFigure.IsNotNull())
       {
         results.emplace_back(planarFigure);
       }
     }
 
     return results;
   }
 
   mitk::PlanarFigureIO::DoubleList mitk::PlanarFigureIO::GetDoubleAttributeListFromXMLNode(
-    TiXmlElement* e, const char* attributeNameBase, unsigned int count)
+    const tinyxml2::XMLElement* e, const char* attributeNameBase, unsigned int count)
   {
     DoubleList list;
 
     if (e == nullptr)
       throw std::invalid_argument("node invalid"); // TODO: can we do a better error handling?
 
     for (unsigned int i = 0; i < count; ++i)
     {
       mitk::ScalarType p(-1.0);
       std::stringstream attributeName;
       attributeName << attributeNameBase << i;
 
-      if (e->QueryDoubleAttribute(attributeName.str().c_str(), &p) == TIXML_WRONG_TYPE)
+      if (e->QueryDoubleAttribute(attributeName.str().c_str(), &p) != tinyxml2::XML_SUCCESS)
         throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
       list.push_back(p);
     }
 
     return list;
   }
 
-  mitk::Point3D mitk::PlanarFigureIO::GetPointFromXMLNode(TiXmlElement* e)
+  mitk::Point3D mitk::PlanarFigureIO::GetPointFromXMLNode(const tinyxml2::XMLElement* e)
   {
     if (e == nullptr)
       throw std::invalid_argument("node invalid"); // TODO: can we do a better error handling?
     mitk::Point3D point;
     mitk::ScalarType p(-1.0);
-    if (e->QueryDoubleAttribute("x", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("x", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     point.SetElement(0, p);
-    if (e->QueryDoubleAttribute("y", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("y", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     point.SetElement(1, p);
-    if (e->QueryDoubleAttribute("z", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("z", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     point.SetElement(2, p);
     return point;
   }
 
-  mitk::Vector3D mitk::PlanarFigureIO::GetVectorFromXMLNode(TiXmlElement* e)
+  mitk::Vector3D mitk::PlanarFigureIO::GetVectorFromXMLNode(const tinyxml2::XMLElement* e)
   {
     if (e == nullptr)
       throw std::invalid_argument("node invalid"); // TODO: can we do a better error handling?
     mitk::Vector3D vector;
     mitk::ScalarType p(-1.0);
-    if (e->QueryDoubleAttribute("x", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("x", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     vector.SetElement(0, p);
-    if (e->QueryDoubleAttribute("y", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("y", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     vector.SetElement(1, p);
-    if (e->QueryDoubleAttribute("z", &p) == TIXML_WRONG_TYPE)
+    if (e->QueryDoubleAttribute("z", &p) != tinyxml2::XML_SUCCESS)
       throw std::invalid_argument("node malformatted"); // TODO: can we do a better error handling?
     vector.SetElement(2, p);
     return vector;
   }
 
   PlanarFigureIO *PlanarFigureIO::IOClone() const { return new PlanarFigureIO(*this); }
 
 } // namespace
diff --git a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
index 215ca99134..2033cfd0a4 100644
--- a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
+++ b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
@@ -1,92 +1,97 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef MITK_PLANAR_FIGURE_IO_H
 #define MITK_PLANAR_FIGURE_IO_H
 
 #include <mitkAbstractFileIO.h>
 #include <mitkPlanarFigure.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
   * Reads/Writes a PlanarFigure to a file
   * @ingroup Process
   */
   class PlanarFigureIO : public mitk::AbstractFileIO
   {
   public:
     typedef mitk::PlanarFigure InputType;
 
     PlanarFigureIO();
 
     // -------------- AbstractFileReader -------------
 
     using AbstractFileReader::Read;
 
     ConfidenceLevel GetReaderConfidenceLevel() const override;
 
     // -------------- AbstractFileWriter -------------
 
     void Write() override;
     ConfidenceLevel GetWriterConfidenceLevel() const override;
 
   protected:
     /**
     * @brief Reads a number of mitk::PlanarFigures from the file system
     * @return a vector of mitk::PlanarFigures
     * @throws throws an mitk::Exception if an error ocurrs during parsing the nrrd header
     */
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
     using DoubleList = std::list<double>;
     /**
     * \brief parses the element for the attributes name0 to nameN, where "name" and the number of attributes
     * to read are passed as argument. Returns a list of double vales.
-    * \param[in] e the TiXmlElement that will be parsed
+    * \param[in] e the XML element that will be parsed
     * \param[in] attributeNameBase the basic name of the parameters
     * \param[in] count the number of parameters
     * \return returns a mitk::Point3D with the values x,y,z
     */
-    DoubleList GetDoubleAttributeListFromXMLNode(TiXmlElement* e, const char* attributeNameBase, unsigned int count);
+    DoubleList GetDoubleAttributeListFromXMLNode(const tinyxml2::XMLElement* e, const char* attributeNameBase, unsigned int count);
 
     /**
     * \brief parses the element for the attributes x,y,z and returns a mitk::Vector3D filled with these values
-    * \param[in] e the TiXmlElement that will be parsed
+    * \param[in] e the XML element that will be parsed
     * \return returns a mitk::Vector3D with the values x,y,z
     */
-    static mitk::Vector3D GetVectorFromXMLNode(TiXmlElement* e);
+    static mitk::Vector3D GetVectorFromXMLNode(const tinyxml2::XMLElement* e);
 
     /**
     * \brief parses the element for the attributes x,y,z and returns a mitk::Point3D filled with these values
-    * \param[in] e the TiXmlElement that will be parsed
+    * \param[in] e the XML element that will be parsed
     * \return returns a mitk::Point3D with the values x,y,z
     */
-    static mitk::Point3D GetPointFromXMLNode(TiXmlElement* e);
+    static mitk::Point3D GetPointFromXMLNode(const tinyxml2::XMLElement* e);
 
     /**Documentation
     * \brief creates a TinyXML element that contains x, y, and z values
     *
+    * \param[in] doc
     * \param[in] name the name of the XML element
     * \param[in] v the vector or point that contains the x, y and z values
-    * \return returns a TiXmlElement named name and three attributes x, y and z.
+    * \return returns a XML element named name and three attributes x, y and z.
     */
-    static TiXmlElement* CreateXMLVectorElement(const char* name, itk::FixedArray<mitk::ScalarType, 3> v);
+    static tinyxml2::XMLElement* CreateXMLVectorElement(tinyxml2::XMLDocument& doc, const char* name, itk::FixedArray<mitk::ScalarType, 3> v);
 
   private:
     PlanarFigureIO *IOClone() const override;
   };
 } // end of namespace mitk
 
 #endif // MITK_PLANAR_FIGURE_IO_H
diff --git a/Modules/SceneSerialization/include/mitkSceneIO.h b/Modules/SceneSerialization/include/mitkSceneIO.h
index 66be8b16f1..588090a2b3 100644
--- a/Modules/SceneSerialization/include/mitkSceneIO.h
+++ b/Modules/SceneSerialization/include/mitkSceneIO.h
@@ -1,134 +1,138 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkSceneIO_h_included
 #define mitkSceneIO_h_included
 
 #include <MitkSceneSerializationExports.h>
 
 #include "mitkDataStorage.h"
 #include "mitkNodePredicateBase.h"
 
 #include <Poco/Zip/ZipLocalFileHeader.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   class BaseData;
   class PropertyList;
 
   class MITKSCENESERIALIZATION_EXPORT SceneIO : public itk::Object
   {
   public:
     mitkClassMacroItkParent(SceneIO, itk::Object);
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
       typedef DataStorage::SetOfObjects FailedBaseDataListType;
 
     /**
      * \brief Load a scene of objects from file
      * \return DataStorage with all scene objects and their relations. If loading failed, query GetFailedNodes() and
      * GetFailedProperties() for more detail.
      *
      * Attempts to read the provided file and create objects with
      * parent/child relations into a DataStorage.
      *
      * \param filename full filename of the scene file
      * \param storage If given, this DataStorage is used instead of a newly created one
      * \param clearStorageFirst If set, the provided DataStorage will be cleared before populating it with the loaded
      * objects
      */
     virtual DataStorage::Pointer LoadScene(const std::string &filename,
                                            DataStorage *storage = nullptr,
                                            bool clearStorageFirst = false);
 
     /**
     * \brief Load a scene of objects from directory.
     * \return DataStorage with all scene objects and their relations. If loading failed, query GetFailedNodes() and
     * GetFailedProperties() for more detail.
     *
     * Does the same like LoadScene, but assumes that the given filename is the index.xml of the scene and the working directory
     * is the directory of the given filename. This function can be used to load an already unpacked scene and create objects with
     * parent/child relations into a DataStorage.
     *
     * \param indexfilename full filename of the scene index file
     * \param storage If given, this DataStorage is used instead of a newly created one
     * \param clearStorageFirst If set, the provided DataStorage will be cleared before populating it with the loaded
     * objects
     */
     virtual DataStorage::Pointer LoadSceneUnzipped(const std::string &indexfilename,
       DataStorage *storage = nullptr,
       bool clearStorageFirst = false);
 
 
     /**
      * \brief Save a scene of objects to file
      * \return True if complete success, false if any problem occurred. Note that a scene file might still be written if
      false is returned,
                it just will not contain every node/property. If writing failed, query GetFailedNodes() and
      GetFailedProperties() for more detail.
      *
      * Attempts to write a scene file, which contains the nodes of the
      * provided DataStorage, their parent/child relations, and properties.
      *
      * \param sceneNodes
      * \param storage a DataStorage containing all nodes that should be saved
      * \param filename
      */
     virtual bool SaveScene(DataStorage::SetOfObjects::ConstPointer sceneNodes,
                            const DataStorage *storage,
                            const std::string &filename);
 
     /**
      * \brief Get a list of nodes (BaseData containers) that failed to be read/written.
      *
      * FailedBaseDataListType hold all those nodes that contain BaseData objects
      * which could not be read or written during the last call to LoadScene or SaveScene.
      */
     const FailedBaseDataListType *GetFailedNodes();
 
     /**
      * \brief Get a list of properties that failed to be read/written.
      *
      * Each entry corresponds to a property which could not
      * be (de)serialized. The properties may come from either of
      * <ul>
      *   <li> The BaseData's PropertyList
      *   <li> The DataNodes's PropertyList
      *   <li> Any of a DataNodes's render window specific PropertyLists
      * </ul>
      */
     const PropertyList *GetFailedProperties();
 
   protected:
     SceneIO();
     ~SceneIO() override;
 
     std::string CreateEmptyTempDirectory();
 
-    TiXmlElement *SaveBaseData(BaseData *data, const std::string &filenamehint, bool &error);
-    TiXmlElement *SavePropertyList(PropertyList *propertyList, const std::string &filenamehint);
+    tinyxml2::XMLElement *SaveBaseData(tinyxml2::XMLDocument &doc, BaseData *data, const std::string &filenamehint, bool &error);
+    tinyxml2::XMLElement *SavePropertyList(tinyxml2::XMLDocument &doc, PropertyList *propertyList, const std::string &filenamehint);
 
     void OnUnzipError(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> &info);
     void OnUnzipOk(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path> &info);
 
     FailedBaseDataListType::Pointer m_FailedNodes;
     PropertyList::Pointer m_FailedProperties;
 
     std::string m_WorkingDirectory;
     unsigned int m_UnzipErrors;
   };
 }
 
 #endif
diff --git a/Modules/SceneSerialization/include/mitkSceneReader.h b/Modules/SceneSerialization/include/mitkSceneReader.h
index e01c62bab3..e3d790dc4f 100644
--- a/Modules/SceneSerialization/include/mitkSceneReader.h
+++ b/Modules/SceneSerialization/include/mitkSceneReader.h
@@ -1,32 +1,35 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include <MitkSceneSerializationExports.h>
 
-#include <tinyxml.h>
-
 #include <itkObjectFactory.h>
 
 #include "mitkDataStorage.h"
 
+namespace tinyxml2
+{
+  class XMLDocument;
+}
+
 namespace mitk
 {
   class MITKSCENESERIALIZATION_EXPORT SceneReader : public itk::Object
   {
   public:
     mitkClassMacroItkParent(SceneReader, itk::Object);
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
-      virtual bool LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage);
+    virtual bool LoadScene(tinyxml2::XMLDocument &document, const std::string &workingDirectory, DataStorage *storage);
   };
 }
diff --git a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.cpp b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.cpp
index fcf615bab7..8c4bd9854b 100644
--- a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.cpp
+++ b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.cpp
@@ -1,63 +1,61 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkGeometryDataSerializer.h"
 #include "mitkGeometry3D.h"
 #include "mitkGeometryData.h"
 #include "mitkIOUtil.h"
 
-#include <tinyxml.h>
-
 MITK_REGISTER_SERIALIZER(GeometryDataSerializer)
 
 mitk::GeometryDataSerializer::GeometryDataSerializer()
 {
 }
 
 mitk::GeometryDataSerializer::~GeometryDataSerializer()
 {
 }
 
 std::string mitk::GeometryDataSerializer::Serialize()
 {
   // Verify good input data type
   const auto *ps = dynamic_cast<const GeometryData *>(m_Data.GetPointer());
   if (ps == nullptr)
   {
     MITK_ERROR << " Object at " << (const void *)this->m_Data << " is not an mitk::GeometryData. Cannot serialize...";
     return "";
   }
 
   // Construct the full filename to store the geometry
   std::string filename(this->GetUniqueFilenameInWorkingDirectory());
   filename += "_";
   filename += m_FilenameHint;
   filename += ".mitkgeometry";
 
   std::string fullname(m_WorkingDirectory);
   fullname += IOUtil::GetDirectorySeparator();
   fullname += filename;
 
   try
   {
     IOUtil::Save(ps, fullname);
     // in case of success, return only the relative filename part
     return filename;
   }
   catch (const std::exception &e)
   {
     MITK_ERROR << "Unable to serialize GeometryData object: " << e.what();
   }
 
   // when failed, return empty string
   return "";
 }
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.cpp b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.cpp
index 0e7f5501a0..2cde291477 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.cpp
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.cpp
@@ -1,88 +1,88 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPropertyListDeserializer.h"
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 mitk::PropertyListDeserializer::PropertyListDeserializer()
 {
 }
 
 mitk::PropertyListDeserializer::~PropertyListDeserializer()
 {
 }
 
 bool mitk::PropertyListDeserializer::Deserialize()
 {
   bool error(false);
 
-  TiXmlDocument document(m_Filename);
-  if (!document.LoadFile())
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS != document.LoadFile(m_Filename.c_str()))
   {
-    MITK_ERROR << "Could not open/read/parse " << m_Filename << "\nTinyXML reports: " << document.ErrorDesc()
+    MITK_ERROR << "Could not open/read/parse " << m_Filename << "\nTinyXML reports: " << document.ErrorStr()
                << std::endl;
     return false;
   }
 
   // find version node --> note version in some variable
   int fileVersion = 1;
-  TiXmlElement *versionObject = document.FirstChildElement("Version");
+  auto *versionObject = document.FirstChildElement("Version");
   if (versionObject)
   {
-    if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != TIXML_SUCCESS)
+    if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != tinyxml2::XML_SUCCESS)
     {
       MITK_ERROR << "Property file " << m_Filename << " does not contain version information! Trying version 1 format."
                  << std::endl;
     }
   }
 
   std::stringstream propertyListDeserializerClassName;
   propertyListDeserializerClassName << "PropertyListDeserializerV" << fileVersion;
 
   std::list<itk::LightObject::Pointer> readers =
     itk::ObjectFactoryBase::CreateAllInstance(propertyListDeserializerClassName.str().c_str());
   if (readers.size() < 1)
   {
     MITK_ERROR << "No property list reader found for file version " << fileVersion;
   }
   if (readers.size() > 1)
   {
     MITK_WARN << "Multiple property list readers found for file version " << fileVersion
               << ". Using arbitrary first one.";
   }
 
   for (auto iter = readers.begin(); iter != readers.end(); ++iter)
   {
     if (auto *reader = dynamic_cast<PropertyListDeserializer *>(iter->GetPointer()))
     {
       reader->SetFilename(m_Filename);
       bool success = reader->Deserialize();
       error |= !success;
       m_PropertyList = reader->GetOutput();
 
       if (error)
       {
         MITK_ERROR << "There were errors while loading property list file " << m_Filename
                    << ". Your data may be corrupted";
       }
       break;
     }
   }
 
   return !error;
 }
 
 mitk::PropertyList::Pointer mitk::PropertyListDeserializer::GetOutput()
 {
   return m_PropertyList;
 }
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.cpp b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.cpp
index 4eafaa51f8..bca359e64d 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.cpp
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.cpp
@@ -1,87 +1,87 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPropertyListDeserializerV1.h"
 #include "mitkBasePropertySerializer.h"
 #include "mitkSerializerMacros.h"
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 MITK_REGISTER_SERIALIZER(PropertyListDeserializerV1)
 
 mitk::PropertyListDeserializerV1::PropertyListDeserializerV1()
 {
 }
 
 mitk::PropertyListDeserializerV1::~PropertyListDeserializerV1()
 {
 }
 
 bool mitk::PropertyListDeserializerV1::Deserialize()
 {
   bool error(false);
 
   m_PropertyList = PropertyList::New();
 
-  TiXmlDocument document(m_Filename);
-  if (!document.LoadFile())
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS != document.LoadFile(m_Filename.c_str()))
   {
-    MITK_ERROR << "Could not open/read/parse " << m_Filename << "\nTinyXML reports: " << document.ErrorDesc()
+    MITK_ERROR << "Could not open/read/parse " << m_Filename << "\nTinyXML reports: " << document.ErrorStr()
                << std::endl;
     return false;
   }
 
-  for (TiXmlElement *propertyElement = document.FirstChildElement("property"); propertyElement != nullptr;
+  for (auto *propertyElement = document.FirstChildElement("property"); propertyElement != nullptr;
        propertyElement = propertyElement->NextSiblingElement("property"))
   {
     const char *keya = propertyElement->Attribute("key");
     std::string key(keya ? keya : "");
 
     const char *typea = propertyElement->Attribute("type");
     std::string type(typea ? typea : "");
 
     // hand propertyElement to specific reader
     std::stringstream propertyDeserializerClassName;
     propertyDeserializerClassName << type << "Serializer";
 
     std::list<itk::LightObject::Pointer> readers =
       itk::ObjectFactoryBase::CreateAllInstance(propertyDeserializerClassName.str().c_str());
     if (readers.size() < 1)
     {
       MITK_ERROR << "No property reader found for " << type;
       error = true;
     }
     if (readers.size() > 1)
     {
       MITK_WARN << "Multiple property readers found for " << type << ". Using arbitrary first one.";
     }
 
     for (auto iter = readers.begin(); iter != readers.end(); ++iter)
     {
       if (auto *reader = dynamic_cast<BasePropertySerializer *>(iter->GetPointer()))
       {
         BaseProperty::Pointer property = reader->Deserialize(propertyElement->FirstChildElement());
         if (property.IsNotNull())
         {
           m_PropertyList->ReplaceProperty(key, property);
         }
         else
         {
           MITK_ERROR << "There were errors while loading property '" << key << "' of type " << type
                      << ". Your data may be corrupted";
           error = true;
         }
         break;
       }
     }
   }
   return !error;
 }
diff --git a/Modules/SceneSerialization/src/mitkSceneIO.cpp b/Modules/SceneSerialization/src/mitkSceneIO.cpp
index a6b5c851af..04db6cf399 100644
--- a/Modules/SceneSerialization/src/mitkSceneIO.cpp
+++ b/Modules/SceneSerialization/src/mitkSceneIO.cpp
@@ -1,578 +1,575 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include <Poco/Delegate.h>
 #include <Poco/Path.h>
 #include <Poco/TemporaryFile.h>
 #include <Poco/Zip/Compress.h>
 #include <Poco/Zip/Decompress.h>
 
 #include "mitkBaseDataSerializer.h"
 #include "mitkPropertyListSerializer.h"
 #include "mitkSceneIO.h"
 #include "mitkSceneReader.h"
 
 #include "mitkBaseRenderer.h"
 #include "mitkProgressBar.h"
 #include "mitkRenderingManager.h"
 #include "mitkStandaloneDataStorage.h"
 #include <mitkLocaleSwitch.h>
 #include <mitkStandardFileLocations.h>
 
 #include <itkObjectFactoryBase.h>
 
-#include <tinyxml.h>
-
 #include <fstream>
 #include <mitkIOUtil.h>
 #include <sstream>
 
 #include "itksys/SystemTools.hxx"
 
+#include <tinyxml2.h>
+
 mitk::SceneIO::SceneIO() : m_WorkingDirectory(""), m_UnzipErrors(0)
 {
 }
 
 mitk::SceneIO::~SceneIO()
 {
 }
 
 std::string mitk::SceneIO::CreateEmptyTempDirectory()
 {
   mitk::UIDGenerator uidGen;
 
   // std::string returnValue = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory() +
   // Poco::Path::separator() + "SceneIOTemp" + uidGen.GetUID();
   std::string returnValue = Poco::Path::temp() + "SceneIOTemp" + uidGen.GetUID();
   std::string uniquename = returnValue + Poco::Path::separator();
   Poco::File tempdir(uniquename);
 
   try
   {
     bool existsNot = tempdir.createDirectory();
     if (!existsNot)
     {
       MITK_ERROR << "Warning: Directory already exitsts: " << uniquename << " (choosing another)";
       returnValue = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory() + Poco::Path::separator() +
                     "SceneIOTempDirectory" + uidGen.GetUID();
       uniquename = returnValue + Poco::Path::separator();
       Poco::File tempdir2(uniquename);
       if (!tempdir2.createDirectory())
       {
         MITK_ERROR << "Warning: Second directory also already exitsts: " << uniquename;
       }
     }
   }
   catch (std::exception &e)
   {
     MITK_ERROR << "Could not create temporary directory " << uniquename << ":" << e.what();
     return "";
   }
 
   return returnValue;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIO::LoadScene(const std::string &filename,
                                                     DataStorage *pStorage,
                                                     bool clearStorageFirst)
 {
   mitk::LocaleSwitch localeSwitch("C");
 
   // prepare data storage
   DataStorage::Pointer storage = pStorage;
   if (storage.IsNull())
   {
     storage = StandaloneDataStorage::New().GetPointer();
   }
 
   // test input filename
   if (filename.empty())
   {
     MITK_ERROR << "No filename given. Not possible to load scene.";
     return storage;
   }
 
   // test if filename can be read
   std::ifstream file(filename.c_str(), std::ios::binary);
   if (!file.good())
   {
     MITK_ERROR << "Cannot open '" << filename << "' for reading";
     return storage;
   }
 
   // get new temporary directory
   m_WorkingDirectory = CreateEmptyTempDirectory();
   if (m_WorkingDirectory.empty())
   {
     MITK_ERROR << "Could not create temporary directory. Cannot open scene files.";
     return storage;
   }
 
   // unzip all filenames contents to temp dir
   m_UnzipErrors = 0;
   Poco::Zip::Decompress unzipper(file, Poco::Path(m_WorkingDirectory));
   unzipper.EError += Poco::Delegate<SceneIO, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(
     this, &SceneIO::OnUnzipError);
   unzipper.EOk += Poco::Delegate<SceneIO, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path>>(
     this, &SceneIO::OnUnzipOk);
   unzipper.decompressAllFiles();
   unzipper.EError -= Poco::Delegate<SceneIO, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(
     this, &SceneIO::OnUnzipError);
   unzipper.EOk -= Poco::Delegate<SceneIO, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path>>(
     this, &SceneIO::OnUnzipOk);
 
   if (m_UnzipErrors)
   {
     MITK_ERROR << "There were " << m_UnzipErrors << " errors unzipping '" << filename
                << "'. Will attempt to read whatever could be unzipped.";
   }
 
   // transcode locale-dependent string
   m_WorkingDirectory = Poco::Path::transcode (m_WorkingDirectory);
 
   auto indexFile = m_WorkingDirectory + mitk::IOUtil::GetDirectorySeparator() + "index.xml";
   storage = LoadSceneUnzipped(indexFile, storage, clearStorageFirst);
 
   // delete temp directory
   try
   {
     Poco::File deleteDir(m_WorkingDirectory);
     deleteDir.remove(true); // recursive
   }
   catch (...)
   {
     MITK_ERROR << "Could not delete temporary directory " << m_WorkingDirectory;
   }
 
   // return new data storage, even if empty or uncomplete (return as much as possible but notify calling method)
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIO::LoadSceneUnzipped(const std::string &indexfilename,
   DataStorage *pStorage,
   bool clearStorageFirst)
 {
   mitk::LocaleSwitch localeSwitch("C");
 
   // prepare data storage
   DataStorage::Pointer storage = pStorage;
   if (storage.IsNull())
   {
     storage = StandaloneDataStorage::New().GetPointer();
   }
 
   if (clearStorageFirst)
   {
     try
     {
       storage->Remove(storage->GetAll());
     }
     catch (...)
     {
       MITK_ERROR << "DataStorage cannot be cleared properly.";
     }
   }
 
   // test input filename
   if (indexfilename.empty())
   {
     MITK_ERROR << "No filename given. Not possible to load scene.";
     return storage;
   }
 
   // transcode locale-dependent string
   std::string tempfilename;
   std::string workingDir;
   itksys::SystemTools::SplitProgramPath(indexfilename, workingDir, tempfilename);
 
   // test if index.xml exists
   // parse index.xml with TinyXML
-  TiXmlDocument document(indexfilename);
-  if (!document.LoadFile())
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS != document.LoadFile(indexfilename.c_str()))
   {
     MITK_ERROR << "Could not open/read/parse " << workingDir << mitk::IOUtil::GetDirectorySeparator()
-      << "index.xml\nTinyXML reports: " << document.ErrorDesc() << std::endl;
+      << "index.xml\nTinyXML reports: " << document.ErrorStr() << std::endl;
     return storage;
   }
 
   SceneReader::Pointer reader = SceneReader::New();
   if (!reader->LoadScene(document, workingDir, storage))
   {
     MITK_ERROR << "There were errors while loading scene file " << indexfilename << ". Your data may be corrupted";
   }
 
   // return new data storage, even if empty or uncomplete (return as much as possible but notify calling method)
   return storage;
 }
 
 bool mitk::SceneIO::SaveScene(DataStorage::SetOfObjects::ConstPointer sceneNodes,
                               const DataStorage *storage,
                               const std::string &filename)
 {
   if (!sceneNodes)
   {
     MITK_ERROR << "No set of nodes given. Not possible to save scene.";
     return false;
   }
   if (!storage)
   {
     MITK_ERROR << "No data storage given. Not possible to save scene."; // \TODO: Technically, it would be possible to
                                                                         // save the nodes without their relation
     return false;
   }
 
   if (filename.empty())
   {
     MITK_ERROR << "No filename given. Not possible to save scene.";
     return false;
   }
 
   mitk::LocaleSwitch localeSwitch("C");
 
   try
   {
     m_FailedNodes = DataStorage::SetOfObjects::New();
     m_FailedProperties = PropertyList::New();
 
     // start XML DOM
-    TiXmlDocument document;
-    auto *decl = new TiXmlDeclaration(
-      "1.0",
-      "UTF-8",
-      ""); // TODO what to write here? encoding? standalone would mean that we provide a DTD somewhere...
-    document.LinkEndChild(decl);
-
-    auto *version = new TiXmlElement("Version");
+    tinyxml2::XMLDocument document;
+    document.InsertEndChild(document.NewDeclaration());
+
+    auto *version = document.NewElement("Version");
     version->SetAttribute("Writer", __FILE__);
     version->SetAttribute("Revision", "$Revision: 17055 $");
     version->SetAttribute("FileVersion", 1);
-    document.LinkEndChild(version);
+    document.InsertEndChild(version);
 
     // DataStorage::SetOfObjects::ConstPointer sceneNodes = storage->GetSubset( predicate );
 
     if (sceneNodes.IsNull())
     {
       MITK_WARN << "Saving empty scene to " << filename;
     }
     else
     {
       if (sceneNodes->size() == 0)
       {
         MITK_WARN << "Saving empty scene to " << filename;
       }
 
       MITK_INFO << "Storing scene with " << sceneNodes->size() << " objects to " << filename;
 
       m_WorkingDirectory = CreateEmptyTempDirectory();
       if (m_WorkingDirectory.empty())
       {
         MITK_ERROR << "Could not create temporary directory. Cannot create scene files.";
         return false;
       }
 
       ProgressBar::GetInstance()->AddStepsToDo(sceneNodes->size());
 
       // find out about dependencies
       typedef std::map<DataNode *, std::string> UIDMapType;
       typedef std::map<DataNode *, std::list<std::string>> SourcesMapType;
 
       UIDMapType nodeUIDs;       // for dependencies: ID of each node
       SourcesMapType sourceUIDs; // for dependencies: IDs of a node's parent nodes
 
       UIDGenerator nodeUIDGen("OBJECT_");
 
       for (auto iter = sceneNodes->begin(); iter != sceneNodes->end(); ++iter)
       {
         DataNode *node = iter->GetPointer();
         if (!node)
           continue; // unlikely event that we get a nullptr pointer as an object for saving. just ignore
 
         // generate UIDs for all source objects
         DataStorage::SetOfObjects::ConstPointer sourceObjects = storage->GetSources(node);
         for (auto sourceIter = sourceObjects->begin();
              sourceIter != sourceObjects->end();
              ++sourceIter)
         {
           if (std::find(sceneNodes->begin(), sceneNodes->end(), *sourceIter) == sceneNodes->end())
             continue; // source is not saved, so don't generate a UID for this source
 
           // create a uid for the parent object
           if (nodeUIDs[*sourceIter].empty())
           {
             nodeUIDs[*sourceIter] = nodeUIDGen.GetUID();
           }
 
           // store this dependency for writing
           sourceUIDs[node].push_back(nodeUIDs[*sourceIter]);
         }
 
         if (nodeUIDs[node].empty())
         {
           nodeUIDs[node] = nodeUIDGen.GetUID();
         }
       }
 
       // write out objects, dependencies and properties
       for (auto iter = sceneNodes->begin(); iter != sceneNodes->end(); ++iter)
       {
         DataNode *node = iter->GetPointer();
 
         if (node)
         {
-          auto *nodeElement = new TiXmlElement("node");
+          auto *nodeElement = document.NewElement("node");
           std::string filenameHint(node->GetName());
           filenameHint = itksys::SystemTools::MakeCindentifier(
             filenameHint.c_str()); // escape filename <-- only allow [A-Za-z0-9_], replace everything else with _
 
           // store dependencies
           auto searchUIDIter = nodeUIDs.find(node);
           if (searchUIDIter != nodeUIDs.end())
           {
             // store this node's ID
             nodeElement->SetAttribute("UID", searchUIDIter->second.c_str());
           }
 
           auto searchSourcesIter = sourceUIDs.find(node);
           if (searchSourcesIter != sourceUIDs.end())
           {
             // store all source IDs
             for (auto sourceUIDIter = searchSourcesIter->second.begin();
                  sourceUIDIter != searchSourcesIter->second.end();
                  ++sourceUIDIter)
             {
-              auto *uidElement = new TiXmlElement("source");
+              auto *uidElement = document.NewElement("source");
               uidElement->SetAttribute("UID", sourceUIDIter->c_str());
-              nodeElement->LinkEndChild(uidElement);
+              nodeElement->InsertEndChild(uidElement);
             }
           }
 
           // store basedata
           if (BaseData *data = node->GetData())
           {
             // std::string filenameHint( node->GetName() );
             bool error(false);
-            TiXmlElement *dataElement(SaveBaseData(data, filenameHint, error)); // returns a reference to a file
+            auto *dataElement = SaveBaseData(document, data, filenameHint, error); // returns a reference to a file
             if (error)
             {
               m_FailedNodes->push_back(node);
             }
 
             // store basedata properties
             PropertyList *propertyList = data->GetPropertyList();
             if (propertyList && !propertyList->IsEmpty())
             {
-              TiXmlElement *baseDataPropertiesElement(
-                SavePropertyList(propertyList, filenameHint + "-data")); // returns a reference to a file
-              dataElement->LinkEndChild(baseDataPropertiesElement);
+              auto *baseDataPropertiesElement =
+                SavePropertyList(document, propertyList, filenameHint + "-data"); // returns a reference to a file
+              dataElement->InsertEndChild(baseDataPropertiesElement);
             }
 
-            nodeElement->LinkEndChild(dataElement);
+            nodeElement->InsertEndChild(dataElement);
           }
 
           // store all renderwindow specific propertylists
           mitk::DataNode::PropertyListKeyNames propertyListKeys = node->GetPropertyListNames();
           for (auto renderWindowName : propertyListKeys)
           {
             PropertyList *propertyList = node->GetPropertyList(renderWindowName);
             if (propertyList && !propertyList->IsEmpty())
             {
-              TiXmlElement *renderWindowPropertiesElement(
-                SavePropertyList(propertyList, filenameHint + "-" + renderWindowName)); // returns a reference to a file
-              renderWindowPropertiesElement->SetAttribute("renderwindow", renderWindowName);
-              nodeElement->LinkEndChild(renderWindowPropertiesElement);
+              auto *renderWindowPropertiesElement =
+                SavePropertyList(document, propertyList, filenameHint + "-" + renderWindowName); // returns a reference to a file
+              renderWindowPropertiesElement->SetAttribute("renderwindow", renderWindowName.c_str());
+              nodeElement->InsertEndChild(renderWindowPropertiesElement);
             }
           }
 
           // don't forget the renderwindow independent list
           PropertyList *propertyList = node->GetPropertyList();
           if (propertyList && !propertyList->IsEmpty())
           {
-            TiXmlElement *propertiesElement(
-              SavePropertyList(propertyList, filenameHint + "-node")); // returns a reference to a file
-            nodeElement->LinkEndChild(propertiesElement);
+            auto *propertiesElement =
+              SavePropertyList(document, propertyList, filenameHint + "-node"); // returns a reference to a file
+            nodeElement->InsertEndChild(propertiesElement);
           }
-          document.LinkEndChild(nodeElement);
+          document.InsertEndChild(nodeElement);
         }
         else
         {
           MITK_WARN << "Ignoring nullptr node during scene serialization.";
         }
 
         ProgressBar::GetInstance()->Progress();
       } // end for all nodes
     }   // end if sceneNodes
 
     std::string defaultLocale_WorkingDirectory = Poco::Path::transcode( m_WorkingDirectory );
 
-    if (!document.SaveFile(defaultLocale_WorkingDirectory + Poco::Path::separator() + "index.xml"))
+    auto xmlFilename = defaultLocale_WorkingDirectory + Poco::Path::separator() + "index.xml";
+    if (tinyxml2::XML_SUCCESS != document.SaveFile(xmlFilename.c_str()))
     {
       MITK_ERROR << "Could not write scene to " << defaultLocale_WorkingDirectory << Poco::Path::separator() << "index.xml"
-                 << "\nTinyXML reports '" << document.ErrorDesc() << "'";
+                 << "\nTinyXML reports '" << document.ErrorStr() << "'";
       return false;
     }
     else
     {
       try
       {
         Poco::File deleteFile(filename.c_str());
         if (deleteFile.exists())
         {
           deleteFile.remove();
         }
 
         // create zip at filename
         std::ofstream file(filename.c_str(), std::ios::binary | std::ios::out);
         if (!file.good())
         {
           MITK_ERROR << "Could not open a zip file for writing: '" << filename << "'";
           return false;
         }
         else
         {
           Poco::Zip::Compress zipper(file, true);
           Poco::Path tmpdir(m_WorkingDirectory);
           zipper.addRecursive(tmpdir);
           zipper.close();
         }
         try
         {
           Poco::File deleteDir(m_WorkingDirectory);
           deleteDir.remove(true); // recursive
         }
         catch (...)
         {
           MITK_ERROR << "Could not delete temporary directory " << m_WorkingDirectory;
           return false; // ok?
         }
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Could not create ZIP file from " << m_WorkingDirectory << "\nReason: " << e.what();
         return false;
       }
       return true;
     }
   }
   catch (std::exception &e)
   {
     MITK_ERROR << "Caught exception during saving temporary files to disk. Error description: '" << e.what() << "'";
     return false;
   }
 }
 
-TiXmlElement *mitk::SceneIO::SaveBaseData(BaseData *data, const std::string &filenamehint, bool &error)
+tinyxml2::XMLElement *mitk::SceneIO::SaveBaseData(tinyxml2::XMLDocument &doc, BaseData *data, const std::string &filenamehint, bool &error)
 {
   assert(data);
   error = true;
 
   // find correct serializer
   // the serializer must
   //  - create a file containing all information to recreate the BaseData object --> needs to know where to put this
   //  file (and a filename?)
   //  - TODO what to do about writers that creates one file per timestep?
-  auto *element = new TiXmlElement("data");
+  auto *element = doc.NewElement("data");
   element->SetAttribute("type", data->GetNameOfClass());
 
   // construct name of serializer class
   std::string serializername(data->GetNameOfClass());
   serializername += "Serializer";
 
   std::list<itk::LightObject::Pointer> thingsThatCanSerializeThis =
     itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
   if (thingsThatCanSerializeThis.size() < 1)
   {
     MITK_ERROR << "No serializer found for " << data->GetNameOfClass() << ". Skipping object";
   }
 
   for (auto iter = thingsThatCanSerializeThis.begin();
        iter != thingsThatCanSerializeThis.end();
        ++iter)
   {
     if (auto *serializer = dynamic_cast<BaseDataSerializer *>(iter->GetPointer()))
     {
       serializer->SetData(data);
       serializer->SetFilenameHint(filenamehint);
       std::string defaultLocale_WorkingDirectory = Poco::Path::transcode( m_WorkingDirectory );
       serializer->SetWorkingDirectory(defaultLocale_WorkingDirectory);
       try
       {
         std::string writtenfilename = serializer->Serialize();
-        element->SetAttribute("file", writtenfilename);
+        element->SetAttribute("file", writtenfilename.c_str());
         error = false;
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Serializer " << serializer->GetNameOfClass() << " failed: " << e.what();
       }
       break;
     }
   }
-  element->SetAttribute("UID", data->GetUID());
+  element->SetAttribute("UID", data->GetUID().c_str());
 
   return element;
 }
 
-TiXmlElement *mitk::SceneIO::SavePropertyList(PropertyList *propertyList, const std::string &filenamehint)
+tinyxml2::XMLElement *mitk::SceneIO::SavePropertyList(tinyxml2::XMLDocument &doc, PropertyList *propertyList, const std::string &filenamehint)
 {
   assert(propertyList);
 
   //  - TODO what to do about shared properties (same object in two lists or behind several keys)?
-  auto *element = new TiXmlElement("properties");
+  auto *element = doc.NewElement("properties");
 
   // construct name of serializer class
   PropertyListSerializer::Pointer serializer = PropertyListSerializer::New();
 
   serializer->SetPropertyList(propertyList);
   serializer->SetFilenameHint(filenamehint);
   std::string defaultLocale_WorkingDirectory = Poco::Path::transcode( m_WorkingDirectory );
   serializer->SetWorkingDirectory(defaultLocale_WorkingDirectory);
   try
   {
     std::string writtenfilename = serializer->Serialize();
-    element->SetAttribute("file", writtenfilename);
+    element->SetAttribute("file", writtenfilename.c_str());
     PropertyList::Pointer failedProperties = serializer->GetFailedProperties();
     if (failedProperties.IsNotNull())
     {
       // move failed properties to global list
       m_FailedProperties->ConcatenatePropertyList(failedProperties, true);
     }
   }
   catch (std::exception &e)
   {
     MITK_ERROR << "Serializer " << serializer->GetNameOfClass() << " failed: " << e.what();
   }
 
   return element;
 }
 
 const mitk::SceneIO::FailedBaseDataListType *mitk::SceneIO::GetFailedNodes()
 {
   return m_FailedNodes.GetPointer();
 }
 
 const mitk::PropertyList *mitk::SceneIO::GetFailedProperties()
 {
   return m_FailedProperties;
 }
 
 void mitk::SceneIO::OnUnzipError(const void * /*pSender*/,
                                  std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> &info)
 {
   ++m_UnzipErrors;
   MITK_ERROR << "Error while unzipping: " << info.second;
 }
 
 void mitk::SceneIO::OnUnzipOk(const void * /*pSender*/,
                               std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path> & /*info*/)
 {
   // MITK_INFO << "Unzipped ok: " << info.second.toString();
 }
diff --git a/Modules/SceneSerialization/src/mitkSceneReader.cpp b/Modules/SceneSerialization/src/mitkSceneReader.cpp
index 1fb3751a86..e47032c47d 100644
--- a/Modules/SceneSerialization/src/mitkSceneReader.cpp
+++ b/Modules/SceneSerialization/src/mitkSceneReader.cpp
@@ -1,61 +1,62 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkSceneReader.h"
+#include <tinyxml2.h>
 
-bool mitk::SceneReader::LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage)
+bool mitk::SceneReader::LoadScene(tinyxml2::XMLDocument &document, const std::string &workingDirectory, DataStorage *storage)
 {
   // find version node --> note version in some variable
   int fileVersion = 1;
-  TiXmlElement *versionObject = document.FirstChildElement("Version");
+  auto *versionObject = document.FirstChildElement("Version");
   if (versionObject)
   {
-    if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != TIXML_SUCCESS)
+    if (versionObject->QueryIntAttribute("FileVersion", &fileVersion) != tinyxml2::XML_SUCCESS)
     {
       MITK_ERROR << "Scene file " << workingDirectory + "/index.xml"
                  << " does not contain version information! Trying version 1 format." << std::endl;
     }
   }
 
   std::stringstream sceneReaderClassName;
   sceneReaderClassName << "SceneReaderV" << fileVersion;
 
   std::list<itk::LightObject::Pointer> sceneReaders =
     itk::ObjectFactoryBase::CreateAllInstance(sceneReaderClassName.str().c_str());
   if (sceneReaders.size() < 1)
   {
     MITK_ERROR << "No scene reader found for scene file version " << fileVersion;
   }
   if (sceneReaders.size() > 1)
   {
     MITK_WARN << "Multiple scene readers found for scene file version " << fileVersion
               << ". Using arbitrary first one.";
   }
 
   for (auto iter = sceneReaders.begin(); iter != sceneReaders.end(); ++iter)
   {
     if (auto *reader = dynamic_cast<SceneReader *>(iter->GetPointer()))
     {
       if (!reader->LoadScene(document, workingDirectory, storage))
       {
         MITK_ERROR << "There were errors while loading scene file "
                    << workingDirectory + "/index.xml. Your data may be corrupted";
         return false;
       }
       else
       {
         return true;
       }
     }
   }
   return false;
 }
diff --git a/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp b/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp
index 5f349a4d22..155f8f20f4 100644
--- a/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp
+++ b/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp
@@ -1,429 +1,430 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkSceneReaderV1.h"
 #include "Poco/Path.h"
 #include "mitkBaseRenderer.h"
 #include "mitkIOUtil.h"
 #include "mitkProgressBar.h"
 #include "mitkPropertyListDeserializer.h"
 #include "mitkSerializerMacros.h"
 #include <mitkUIDManipulator.h>
 #include <mitkRenderingModeProperty.h>
+#include <tinyxml2.h>
 
 MITK_REGISTER_SERIALIZER(SceneReaderV1)
 
 namespace
 {
   typedef std::pair<mitk::DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
 
   bool NodeSortByLayerIsLessThan(const NodesAndParentsPair &left, const NodesAndParentsPair &right)
   {
     if (left.first.IsNotNull() && right.first.IsNotNull())
     {
       int leftLayer;
       int rightLayer;
       if (left.first->GetIntProperty("layer", leftLayer) && right.first->GetIntProperty("layer", rightLayer))
       {
         return leftLayer < rightLayer;
       }
       else
       {
         // fall back to name sort
         return left.first->GetName() < right.first->GetName();
       }
     }
 
     // in all other cases, fall back to stupid pointer comparison
     // this is not reasonable but at least answers the sorting
     // question clearly
     return left.first.GetPointer() < right.first.GetPointer();
   }
 }
 
-bool mitk::SceneReaderV1::LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage)
+bool mitk::SceneReaderV1::LoadScene(tinyxml2::XMLDocument &document, const std::string &workingDirectory, DataStorage *storage)
 {
   assert(storage);
   bool error(false);
 
   // TODO prepare to detect errors (such as cycles) from wrongly written or edited xml files
 
   // Get number of elements to initialze progress bar
   //   1. if there is a <data type="..." file="..."> element,
   //        - construct a name for the appropriate serializer
   //        - try to instantiate this serializer via itk object factory
   //        - if serializer could be created, use it to read the file into a BaseData object
   //        - if successful, call the new node's SetData(..)
 
   // create a node for the tag "data" and test if node was created
   typedef std::vector<mitk::DataNode::Pointer> DataNodeVector;
   DataNodeVector DataNodes;
   unsigned int listSize = 0;
-  for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr;
+  for (auto *element = document.FirstChildElement("node"); element != nullptr;
        element = element->NextSiblingElement("node"))
   {
     ++listSize;
   }
 
   ProgressBar::GetInstance()->AddStepsToDo(listSize * 2);
 
-  for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr;
+  for (auto *element = document.FirstChildElement("node"); element != nullptr;
        element = element->NextSiblingElement("node"))
   {
     DataNodes.push_back(LoadBaseDataFromDataTag(element->FirstChildElement("data"), workingDirectory, error));
     ProgressBar::GetInstance()->Progress();
   }
 
   // iterate all nodes
   // first level nodes should be <node> elements
   auto nit = DataNodes.begin();
-  for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr || nit != DataNodes.end();
+  for (auto *element = document.FirstChildElement("node"); element != nullptr || nit != DataNodes.end();
        element = element->NextSiblingElement("node"), ++nit)
   {
     mitk::DataNode::Pointer node = *nit;
     // in case dataXmlElement is valid test whether it containts the "properties" child tag
     // and process further if and only if yes
-    TiXmlElement *dataXmlElement = element->FirstChildElement("data");
+    auto *dataXmlElement = element->FirstChildElement("data");
     if (dataXmlElement && dataXmlElement->FirstChildElement("properties"))
     {
-      TiXmlElement *baseDataElement = dataXmlElement->FirstChildElement("properties");
+      auto *baseDataElement = dataXmlElement->FirstChildElement("properties");
       if (node->GetData())
       {
         DecorateBaseDataWithProperties(node->GetData(), baseDataElement, workingDirectory);
       }
       else
       {
         MITK_WARN << "BaseData properties stored in scene file, but BaseData could not be read" << std::endl;
       }
     }
 
     //   2. check child nodes
     const char *uida = element->Attribute("UID");
     std::string uid("");
 
     if (uida)
     {
       uid = uida;
       m_NodeForID[uid] = node.GetPointer();
       m_IDForNode[node.GetPointer()] = uid;
     }
     else
     {
       MITK_ERROR << "No UID found for current node. Node will have no parents.";
       error = true;
     }
 
     //   3. if there are <properties> nodes,
     //        - instantiate the appropriate PropertyListDeSerializer
     //        - use them to construct PropertyList objects
     //        - add these properties to the node (if necessary, use renderwindow name)
     bool success = DecorateNodeWithProperties(node, element, workingDirectory);
     if (!success)
     {
       MITK_ERROR << "Could not load properties for node.";
       error = true;
     }
 
     // remember node for later adding to DataStorage
     m_OrderedNodePairs.push_back(std::make_pair(node, std::list<std::string>()));
 
     //   4. if there are <source> elements, remember parent objects
-    for (TiXmlElement *source = element->FirstChildElement("source"); source != nullptr;
+    for (auto *source = element->FirstChildElement("source"); source != nullptr;
          source = source->NextSiblingElement("source"))
     {
       const char *sourceUID = source->Attribute("UID");
       if (sourceUID)
       {
         m_OrderedNodePairs.back().second.push_back(std::string(sourceUID));
       }
     }
 
     ProgressBar::GetInstance()->Progress();
   } // end for all <node>
 
   // sort our nodes by their "layer" property
   // (to be inserted in that order)
   m_OrderedNodePairs.sort(&NodeSortByLayerIsLessThan);
 
   // remove all unknown parent UIDs
   for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end();
        ++nodesIter)
   {
     for (auto parentsIter = nodesIter->second.begin();
          parentsIter != nodesIter->second.end();)
     {
       if (m_NodeForID.find(*parentsIter) == m_NodeForID.end())
       {
         parentsIter = nodesIter->second.erase(parentsIter);
         MITK_WARN << "Found a DataNode with unknown parents. Will add it to DataStorage without any parent objects.";
         error = true;
       }
       else
       {
         ++parentsIter;
       }
     }
   }
 
   // repeat the following loop ...
   //   ... for all created nodes
   unsigned int lastMapSize(0);
   while (lastMapSize !=
          m_OrderedNodePairs
            .size()) // this is to prevent infinite loops; each iteration must at least add one node to DataStorage
   {
     lastMapSize = m_OrderedNodePairs.size();
 
     // iterate (layer) ordered nodes backwards
     // we insert the highest layers first
     for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end();
          ++nodesIter)
     {
       bool addThisNode(true);
 
       // if any parent node is not yet in DataStorage, skip node for now and check later
       for (auto parentsIter = nodesIter->second.begin();
            parentsIter != nodesIter->second.end();
            ++parentsIter)
       {
         if (!storage->Exists(m_NodeForID[*parentsIter]))
         {
           addThisNode = false;
           break;
         }
       }
 
       if (addThisNode)
       {
         DataStorage::SetOfObjects::Pointer parents = DataStorage::SetOfObjects::New();
         for (auto parentsIter = nodesIter->second.begin();
              parentsIter != nodesIter->second.end();
              ++parentsIter)
         {
           parents->push_back(m_NodeForID[*parentsIter]);
         }
 
         // if all parents are found in datastorage (or are unknown), add node to DataStorage
         storage->Add(nodesIter->first, parents);
 
         // remove this node from m_OrderedNodePairs
         m_OrderedNodePairs.erase(nodesIter);
 
         // break this for loop because iterators are probably invalid
         break;
       }
     }
   }
 
   // All nodes that are still in m_OrderedNodePairs at this point are not part of a proper directed graph structure.
   // We'll add such nodes without any parent information.
   for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end();
        ++nodesIter)
   {
     storage->Add(nodesIter->first);
     MITK_WARN << "Encountered node that is not part of a directed graph structure. Will be added to DataStorage "
                  "without parents.";
     error = true;
   }
 
   return !error;
 }
 
-mitk::DataNode::Pointer mitk::SceneReaderV1::LoadBaseDataFromDataTag(TiXmlElement *dataElement,
+mitk::DataNode::Pointer mitk::SceneReaderV1::LoadBaseDataFromDataTag(const tinyxml2::XMLElement *dataElement,
                                                                      const std::string &workingDirectory,
                                                                      bool &error)
 {
   DataNode::Pointer node;
 
   if (dataElement)
   {
     const char *filename = dataElement->Attribute("file");
     if (filename && strlen(filename) != 0)
     {
       try
       {
         std::vector<BaseData::Pointer> baseData = IOUtil::Load(workingDirectory + Poco::Path::separator() + filename);
         if (baseData.size() > 1)
         {
           MITK_WARN << "Discarding multiple base data results from " << filename << " except the first one.";
         }
         node = DataNode::New();
         node->SetData(baseData.front());
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Error during attempt to read '" << filename << "'. Exception says: " << e.what();
         error = true;
       }
 
       if (node.IsNull())
       {
         MITK_ERROR << "Error during attempt to read '" << filename << "'. Factory returned nullptr object.";
         error = true;
       }
     }
 
     const char* dataUID = dataElement->Attribute("UID");
-    if (!error && nullptr != dataUID && 0 != strlen(dataUID))
+    if (!error && dataUID != nullptr)
     {
       UIDManipulator manip(node->GetData());
       manip.SetUID(dataUID);
     }
   }
 
   // in case there was no <data> element we create a new empty node (for appending a propertylist later)
   if (node.IsNull())
   {
     node = DataNode::New();
   }
 
   return node;
 }
 
 void mitk::SceneReaderV1::ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList)
 {
   // Basically call propertyList.Clear(), but implement exceptions (see bug 19354)
   BaseData *data = node.GetData();
 
   PropertyList::Pointer propertiesToKeep = PropertyList::New();
 
   if (dynamic_cast<Image *>(data))
   {
     /*
       Older scene files (before changes of bug 17547) could contain
       a RenderingMode property with value "LevelWindow_Color".
       Since bug 17547 this value has been removed and replaced by
       the default value LookupTable_LevelWindow_Color.
 
       This new default value does only result in "black-to-white"
       CT images (or others) if there is a corresponding lookup
       table. Such a lookup table is provided as a default value
       by the Image mapper. Since that value was never present in
       older scene files, we do well in not removing the new
       default value here. Otherwise the mapper would fall back
       to another default which is all the colors of the rainbow :-(
     */
     BaseProperty::Pointer lutProperty = propertyList.GetProperty("LookupTable");
     propertiesToKeep->SetProperty("LookupTable", lutProperty);
 
     /*
       Older scene files (before changes of T14807) may contain
       multi-component images without the "Image.Displayed Component"
       property.
 
       As the treatment as multi-component image and the corresponding
       visualization options hinges on that property we should not delete
       it, if it was added by the mapper.
 
       This is a fix for the issue reported in T19919.
     */
     BaseProperty::Pointer compProperty = propertyList.GetProperty("Image.Displayed Component");
     if (compProperty.IsNotNull())
     {
       propertiesToKeep->SetProperty("Image.Displayed Component", compProperty);
     }
   }
 
   propertyList.Clear();
 
   propertyList.ConcatenatePropertyList(propertiesToKeep);
 }
 
 bool mitk::SceneReaderV1::DecorateNodeWithProperties(DataNode *node,
-                                                     TiXmlElement *nodeElement,
+                                                     const tinyxml2::XMLElement *nodeElement,
                                                      const std::string &workingDirectory)
 {
   assert(node);
   assert(nodeElement);
   bool error(false);
 
-  for (TiXmlElement *properties = nodeElement->FirstChildElement("properties"); properties != nullptr;
+  for (auto *properties = nodeElement->FirstChildElement("properties"); properties != nullptr;
        properties = properties->NextSiblingElement("properties"))
   {
     const char *propertiesfilea(properties->Attribute("file"));
     std::string propertiesfile(propertiesfilea ? propertiesfilea : "");
 
     const char *renderwindowa(properties->Attribute("renderwindow"));
     std::string renderwindow(renderwindowa ? renderwindowa : "");
 
     PropertyList::Pointer propertyList =
       node->GetPropertyList(renderwindow); // DataNode implementation always returns a propertylist
     ClearNodePropertyListWithExceptions(*node, *propertyList);
 
     // use deserializer to construct new properties
     PropertyListDeserializer::Pointer deserializer = PropertyListDeserializer::New();
 
     deserializer->SetFilename(workingDirectory + Poco::Path::separator() + propertiesfile);
     bool success = deserializer->Deserialize();
     error |= !success;
     PropertyList::Pointer readProperties = deserializer->GetOutput();
 
     if (readProperties.IsNotNull())
     {
       propertyList->ConcatenatePropertyList(readProperties, true); // true = replace
     }
     else
     {
       MITK_ERROR << "Property list reader did not return a property list. This is an implementation error. Please tell "
                     "your developer.";
       error = true;
     }
   }
 
   return !error;
 }
 
 bool mitk::SceneReaderV1::DecorateBaseDataWithProperties(BaseData::Pointer data,
-                                                         TiXmlElement *baseDataNodeElem,
+                                                         const tinyxml2::XMLElement *baseDataNodeElem,
                                                          const std::string &workingDir)
 {
   // check given variables, initialize error variable
   assert(baseDataNodeElem);
   bool error(false);
 
   // get the file name stored in the <properties ...> tag
   const char *baseDataPropertyFile(baseDataNodeElem->Attribute("file"));
   // check if the filename was found
   if (baseDataPropertyFile)
   {
     // PropertyList::Pointer dataPropList = data->GetPropertyList();
 
     PropertyListDeserializer::Pointer propertyDeserializer = PropertyListDeserializer::New();
 
     // initialize the property reader
     propertyDeserializer->SetFilename(workingDir + Poco::Path::separator() + baseDataPropertyFile);
     bool ioSuccess = propertyDeserializer->Deserialize();
     error = !ioSuccess;
 
     // get the output
     PropertyList::Pointer inProperties = propertyDeserializer->GetOutput();
 
     // store the read-in properties to the given node or throw error otherwise
     if (inProperties.IsNotNull())
     {
       data->SetPropertyList(inProperties);
     }
     else
     {
       MITK_ERROR << "The property deserializer did not return a (valid) property list.";
       error = true;
     }
   }
   else
   {
-    MITK_ERROR << "Function DecorateBaseDataWithProperties(...) called with false TiXmlElement. \n \t ->Given element "
+    MITK_ERROR << "Function DecorateBaseDataWithProperties(...) called with false XML element. \n \t ->Given element "
                   "does not contain a 'file' attribute. \n";
     error = true;
   }
 
   return !error;
 }
diff --git a/Modules/SceneSerialization/src/mitkSceneReaderV1.h b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
index 9ba5964e93..548fbe428a 100644
--- a/Modules/SceneSerialization/src/mitkSceneReaderV1.h
+++ b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
@@ -1,74 +1,79 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkSceneReader.h"
 
+namespace tinyxml2
+{
+  class XMLElement;
+}
+
 namespace mitk
 {
   class SceneReaderV1 : public SceneReader
   {
   public:
     mitkClassMacro(SceneReaderV1, SceneReader);
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
-      bool LoadScene(TiXmlDocument &document,
+    bool LoadScene(tinyxml2::XMLDocument &document,
                              const std::string &workingDirectory,
                              DataStorage *storage) override;
 
   protected:
     /**
       \brief tries to create one DataNode from a given XML \<node\> element
     */
-    DataNode::Pointer LoadBaseDataFromDataTag(TiXmlElement *dataElement,
+    DataNode::Pointer LoadBaseDataFromDataTag(const tinyxml2::XMLElement *dataElement,
                                               const std::string &workingDirectory,
                                               bool &error);
 
     /**
       \brief reads all the properties from the XML document and recreates them in node
     */
-    bool DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory);
+    bool DecorateNodeWithProperties(DataNode *node, const tinyxml2::XMLElement *nodeElement, const std::string &workingDirectory);
 
     /**
       \brief Clear a default property list and handle some exceptions.
 
       Called after assigning a BaseData object to a fresh DataNode via SetData().
       This call to SetData() would create default properties that have not been
       there when saving the scene. Since they can produce problems, we clear the
       list and use only those properties that we read from the scene file.
 
       This method also handles some exceptions for backwards compatibility.
       Those exceptions are documented directly in the code of the method.
     */
     void ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList);
 
     /**
       \brief reads all properties assigned to a base data element and assigns the list to the base data object
 
       The baseDataNodeElem is supposed to be the \c \<properties file="..."\> element.
     */
     bool DecorateBaseDataWithProperties(BaseData::Pointer data,
-                                        TiXmlElement *baseDataNodeElem,
+                                        const tinyxml2::XMLElement *baseDataNodeElem,
                                         const std::string &workingDir);
 
     typedef std::pair<DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
     typedef std::list<NodesAndParentsPair> OrderedNodesList;
     typedef std::map<std::string, DataNode *> IDToNodeMappingType;
     typedef std::map<DataNode *, std::string> NodeToIDMappingType;
 
     OrderedNodesList m_OrderedNodePairs;
     IDToNodeMappingType m_NodeForID;
     NodeToIDMappingType m_IDForNode;
 
     UIDGenerator m_UIDGen;
   };
 }
diff --git a/Modules/SceneSerialization/test/mitkSceneIOTest.cpp b/Modules/SceneSerialization/test/mitkSceneIOTest.cpp
index 9644a18111..f37faa9b4f 100644
--- a/Modules/SceneSerialization/test/mitkSceneIOTest.cpp
+++ b/Modules/SceneSerialization/test/mitkSceneIOTest.cpp
@@ -1,373 +1,374 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkTestingConfig.h"
 #include "mitkTestingMacros.h"
 
 #include "mitkSceneIO.h"
 
 #include "Poco/File.h"
 #include "Poco/TemporaryFile.h"
 #include "mitkBaseData.h"
 #include "mitkCoreObjectFactory.h"
 #include "mitkGeometryData.h"
 #include "mitkIOUtil.h"
 #include "mitkImage.h"
 #include "mitkPointSet.h"
 #include "mitkStandaloneDataStorage.h"
 #include "mitkStandardFileLocations.h"
 #include "mitkSurface.h"
 
 #ifndef WIN32
 #include <cerrno>
 #include <ulimit.h>
 #endif
 
 class SceneIOTestClass
 {
 public:
   static mitk::Image::Pointer LoadImage(const std::string &filename)
   {
     mitk::Image::Pointer image = mitk::IOUtil::Load<mitk::Image>(filename);
     if (image.IsNull())
     {
       MITK_TEST_FAILED_MSG(<< "Test image '" << filename << "' was not loaded as an mitk::Image");
     }
     return image;
   }
 
   static mitk::Surface::Pointer LoadSurface(const std::string &filename)
   {
     mitk::Surface::Pointer surface = mitk::IOUtil::Load<mitk::Surface>(filename);
     if (surface.IsNull())
     {
       MITK_TEST_FAILED_MSG(<< "Test surface '" << filename << "' was not loaded as an mitk::Surface");
     }
     return surface;
   }
 
   static mitk::PointSet::Pointer CreatePointSet()
   {
     mitk::PointSet::Pointer ps = mitk::PointSet::New();
     mitk::PointSet::PointType p;
     mitk::FillVector3D(p, 1.0, -2.0, 33.0);
     ps->SetPoint(0, p);
     mitk::FillVector3D(p, 100.0, -200.0, 3300.0);
     ps->SetPoint(1, p);
     mitk::FillVector3D(p, 2.0, -3.0, 22.0);
     ps->SetPoint(2, p, mitk::PTCORNER); // add point spec
     // mitk::FillVector3D(p, -2.0, -2.0, -2.22);
     // ps->SetPoint(0, p, 1); // ID 0 in timestep 1
     // mitk::FillVector3D(p, -1.0, -1.0, -11.22);
     // ps->SetPoint(1, p, 1); // ID 1 in timestep 1
     // mitk::FillVector3D(p, 1000.0, 1000.0, 1122.22);
     // ps->SetPoint(11, p, mitk::PTCORNER, 2); // ID 11, point spec, timestep 2
     return ps;
   }
 
   static mitk::GeometryData::Pointer CreateGeometryDataObject()
   {
     mitk::GeometryData::Pointer gdata = mitk::GeometryData::New();
 
     // define Geometry3D parameters
     mitk::AffineTransform3D::MatrixType matrix;
     matrix[0][0] = 1.1;
     matrix[1][1] = 2.2;
     matrix[2][2] = 3.3;
     mitk::AffineTransform3D::OffsetType offset;
     mitk::FillVector3D(offset, 0.1, 0.2, 0.3);
     bool isImageGeometry(false);
     unsigned int frameOfReferenceID(47);
     mitk::BaseGeometry::BoundsArrayType bounds;
+    bounds.Fill(1.1);
     mitk::Point3D origin;
     mitk::FillVector3D(origin, 5.1, 5.2, 5.3);
     mitk::Vector3D spacing;
     mitk::FillVector3D(spacing, 2.1, 2.2, 2.3);
 
     // build GeometryData from matrix/offset/etc.
     mitk::AffineTransform3D::Pointer newTransform = mitk::AffineTransform3D::New();
     newTransform->SetMatrix(matrix);
     newTransform->SetOffset(offset);
 
     mitk::Geometry3D::Pointer newGeometry = mitk::Geometry3D::New();
     newGeometry->SetFrameOfReferenceID(frameOfReferenceID);
     newGeometry->SetImageGeometry(isImageGeometry);
 
     newGeometry->SetIndexToWorldTransform(newTransform);
 
     newGeometry->SetBounds(bounds);
     newGeometry->SetOrigin(origin);
     newGeometry->SetSpacing(spacing);
 
     mitk::GeometryData::Pointer newGeometryData = mitk::GeometryData::New();
     gdata->SetGeometry(newGeometry);
 
     return gdata;
   }
 
   static void FillStorage(mitk::DataStorage *storage, std::string imageName, std::string surfaceName)
   {
     mitk::Image::Pointer image = LoadImage(imageName);
     MITK_TEST_CONDITION_REQUIRED(image.IsNotNull(), "Loading test image" + imageName);
 
     image->SetProperty("image type", mitk::StringProperty::New("test image"));
     image->SetProperty("greetings", mitk::StringProperty::New("to mom"));
     image->SetProperty("test_float_property", mitk::FloatProperty::New(-2.57f));
 
     mitk::DataNode::Pointer imagenode = mitk::DataNode::New();
     imagenode->SetData(image);
     imagenode->SetName("Pic3D");
     storage->Add(imagenode);
 
     mitk::DataNode::Pointer imagechildnode = mitk::DataNode::New();
     imagechildnode->SetData(image);
     imagechildnode->SetName("Pic3D again");
     storage->Add(imagechildnode, imagenode);
 
     mitk::Surface::Pointer surface = LoadSurface(surfaceName);
     MITK_TEST_CONDITION_REQUIRED(surface.IsNotNull(), "Loading test surface binary.stl");
 
     surface->SetProperty("surface type", mitk::StringProperty::New("test surface"));
     surface->SetProperty("greetings", mitk::StringProperty::New("to dad"));
 
     mitk::DataNode::Pointer surfacenode = mitk::DataNode::New();
     surfacenode->SetData(surface);
     surfacenode->SetName("binary");
     storage->Add(surfacenode);
 
     mitk::PointSet::Pointer ps = CreatePointSet();
     mitk::DataNode::Pointer psenode = mitk::DataNode::New();
     psenode->SetData(ps);
     psenode->SetName("points");
     storage->Add(psenode);
 
     mitk::GeometryData::Pointer gdo = CreateGeometryDataObject();
     mitk::DataNode::Pointer geomNode = mitk::DataNode::New();
     geomNode->SetData(gdo);
     geomNode->SetName("geometry3d");
     storage->Add(geomNode);
   }
 
   static void VerifyStorage(mitk::DataStorage *storage)
   {
     mitk::DataNode::Pointer imagenode = storage->GetNamedNode("Pic3D");
     MITK_TEST_CONDITION_REQUIRED(imagenode.IsNotNull(), "Get previously stored image node");
 
     mitk::Image::Pointer image = dynamic_cast<mitk::Image *>(imagenode->GetData());
     MITK_TEST_CONDITION_REQUIRED(image.IsNotNull(), "Loading test image from Datastorage");
 
     // Image
     std::string testString("");
     float testFloatValue = 0.0f;
     mitk::PropertyList::Pointer imagePropList = image->GetPropertyList();
 
     imagePropList->GetStringProperty("image type", testString);
     MITK_TEST_CONDITION(testString == "test image", "Get StringProperty from previously stored image");
 
     imagePropList->GetStringProperty("greetings", testString);
     MITK_TEST_CONDITION(testString == "to mom", "Get another StringProperty from previously stored image");
 
     imagePropList->GetFloatProperty("test_float_property", testFloatValue);
     MITK_TEST_CONDITION(testFloatValue == -2.57f, "Get FloatProperty from previously stored image.")
 
     // Get Image child node
     mitk::DataNode::Pointer imagechildnode = storage->GetNamedNode("Pic3D again");
     mitk::DataStorage::SetOfObjects::ConstPointer objects = storage->GetSources(imagechildnode);
 
     MITK_TEST_CONDITION_REQUIRED(objects->Size() == 1, "Check size of image child nodes source list");
     MITK_TEST_CONDITION_REQUIRED(objects->ElementAt(0) == imagenode, "Check for right parent node");
 
     mitk::Image::Pointer imagechild = dynamic_cast<mitk::Image *>(imagechildnode->GetData());
     MITK_TEST_CONDITION_REQUIRED(imagechild.IsNotNull(), "Loading child test image from Datastorage");
 
     // Surface
     mitk::DataNode::Pointer surfacenode = storage->GetNamedNode("binary");
     MITK_TEST_CONDITION_REQUIRED(surfacenode.IsNotNull(), "Get previously stored surface node");
 
     mitk::Surface::Pointer surface = dynamic_cast<mitk::Surface *>(surfacenode->GetData());
     MITK_TEST_CONDITION_REQUIRED(surface.IsNotNull(), "Loading test surface from Datastorage");
 
     // Get the property list and test the properties
     mitk::PropertyList::Pointer surfacePropList = surface->GetPropertyList();
     surfacePropList->GetStringProperty("surface type", testString);
     MITK_TEST_CONDITION((testString.compare("test surface") == 0),
                         "Get StringProperty from previously stored surface node");
 
     surfacePropList->GetStringProperty("greetings", testString);
     MITK_TEST_CONDITION((testString.compare("to dad") == 0),
                         "Get another StringProperty from previously stored surface node");
 
     // PointSet
     mitk::DataNode::Pointer pointsnode = storage->GetNamedNode("points");
     MITK_TEST_CONDITION_REQUIRED(pointsnode.IsNotNull(), "Get previously stored PointSet node");
 
     mitk::PointSet::Pointer pointset = dynamic_cast<mitk::PointSet *>(pointsnode->GetData());
     MITK_TEST_CONDITION_REQUIRED(pointset.IsNotNull(), "Loading test PointSet from Datastorage");
 
     mitk::PointSet::PointType p = pointset->GetPoint(0);
     MITK_TEST_CONDITION_REQUIRED(p[0] == 1.0 && p[1] == -2.0 && p[2] == 33.0, "Test Pointset entry 0 after loading");
 
     p = pointset->GetPoint(1);
     MITK_TEST_CONDITION_REQUIRED(p[0] == 100.0 && p[1] == -200.0 && p[2] == 3300.0,
                                  "Test Pointset entry 1 after loading");
 
     p = pointset->GetPoint(2);
     MITK_TEST_CONDITION_REQUIRED(p[0] == 2.0 && p[1] == -3.0 && p[2] == 22.0, "Test Pointset entry 2 after loading");
 
     // GeometryData
     mitk::DataNode::Pointer geomnode = storage->GetNamedNode("geometry3d");
     MITK_TEST_CONDITION_REQUIRED(geomnode.IsNotNull(), "Get previously stored GeometryData node");
 
     mitk::GeometryData::Pointer gdata = dynamic_cast<mitk::GeometryData *>(geomnode->GetData());
     MITK_TEST_CONDITION_REQUIRED(gdata.IsNotNull(), "Loading test GeometryData from Datastorage");
 
     mitk::Geometry3D::Pointer geom3D = dynamic_cast<mitk::Geometry3D *>(gdata->GetGeometry());
     MITK_TEST_CONDITION_REQUIRED(geom3D.IsNotNull(), "Reconstructed a Geometry3D from serialization");
     MITK_TEST_CONDITION(geom3D->GetImageGeometry() == false, "Reconstructed Geometry3D 'is image geometry'");
     MITK_TEST_CONDITION(geom3D->GetFrameOfReferenceID() == 47, "Reconstructa Geometry3D has frame of reference '47'");
 
     // TODO test other properties, BUT don't test too much, that shall be done in a reader/writer test!
   }
 }; // end test helper class
 
 int mitkSceneIOTest(int, char *argv[])
 {
   MITK_TEST_BEGIN("SceneIO")
   std::string sceneFileName;
 
   for (unsigned int i = 0; i < 1; ++i) // TODO change to " < 2" to check cases where file system would be full
   {
     if (i == 1)
     {
 // call ulimit and restrict maximum file size to something small
 #ifndef WIN32
       errno = 0;
       long int value = ulimit(UL_SETFSIZE, 1);
       MITK_TEST_CONDITION_REQUIRED(value != -1, "ulimit() returned with errno = " << errno);
 #else
       continue;
 #endif
     }
 
     // create a data storage and fill it with some test data
     mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
     MITK_TEST_CONDITION_REQUIRED(sceneIO.IsNotNull(), "SceneIO instantiation")
 
     mitk::DataStorage::Pointer storage = mitk::StandaloneDataStorage::New().GetPointer();
     MITK_TEST_CONDITION_REQUIRED(storage.IsNotNull(), "StandaloneDataStorage instantiation");
 
     std::cout << "ImageName: " << argv[1] << std::endl;
     std::cout << "SurfaceName: " << argv[2] << std::endl;
 
     SceneIOTestClass::FillStorage(storage, argv[1], argv[2]);
 
     // attempt to save it
     Poco::Path newname(Poco::TemporaryFile::tempName());
     sceneFileName = std::string(MITK_TEST_OUTPUT_DIR) + Poco::Path::separator() + newname.getFileName() + ".zip";
     MITK_TEST_CONDITION_REQUIRED(sceneIO->SaveScene(storage->GetAll(), storage, sceneFileName),
                                  "Saving scene file '" << sceneFileName << "'");
 
     // test if no errors were reported
     mitk::SceneIO::FailedBaseDataListType::ConstPointer failedNodes = sceneIO->GetFailedNodes();
     if (failedNodes.IsNotNull() && !failedNodes->empty())
     {
       MITK_TEST_OUTPUT(<< "The following nodes could not be serialized:");
       for (auto iter = failedNodes->begin();
            iter != failedNodes->end();
            ++iter)
       {
         MITK_TEST_OUTPUT_NO_ENDL(<< " - ");
         if (mitk::BaseData *data = (*iter)->GetData())
         {
           MITK_TEST_OUTPUT_NO_ENDL(<< data->GetNameOfClass());
         }
         else
         {
           MITK_TEST_OUTPUT_NO_ENDL(<< "(nullptr)");
         }
 
         MITK_TEST_OUTPUT(<< " contained in node '" << (*iter)->GetName() << "'");
         // \TODO: should we fail the test case if failed properties exist?
       }
     }
 
     mitk::PropertyList::ConstPointer failedProperties = sceneIO->GetFailedProperties();
     if (failedProperties.IsNotNull() && !failedProperties->IsEmpty())
     {
       MITK_TEST_OUTPUT(<< "The following properties could not be serialized:");
       const mitk::PropertyList::PropertyMap *propmap = failedProperties->GetMap();
       for (auto iter = propmap->begin(); iter != propmap->end(); ++iter)
       {
         MITK_TEST_OUTPUT(<< " - " << iter->second->GetNameOfClass() << " associated to key '" << iter->first << "'");
         // \TODO: should we fail the test case if failed properties exist?
       }
     }
     MITK_TEST_CONDITION_REQUIRED(failedProperties.IsNotNull() && failedProperties->IsEmpty(),
                                  "Checking if all properties have been saved.")
     MITK_TEST_CONDITION_REQUIRED(failedNodes.IsNotNull() && failedNodes->empty(),
                                  "Checking if all nodes have been saved.")
 
     // Now do the loading part
     sceneIO = mitk::SceneIO::New();
 
     // Load scene into the datastorage and clean the DS first
     MITK_TEST_OUTPUT(<< "Loading scene again");
     storage = sceneIO->LoadScene(sceneFileName, storage, true);
 
     // test if no errors were reported
     failedNodes = sceneIO->GetFailedNodes();
     if (failedNodes.IsNotNull() && !failedNodes->empty())
     {
       MITK_TEST_OUTPUT(<< "The following nodes could not be serialized:");
       for (auto iter = failedNodes->begin();
            iter != failedNodes->end();
            ++iter)
       {
         MITK_TEST_OUTPUT_NO_ENDL(<< " - ");
         if (mitk::BaseData *data = (*iter)->GetData())
         {
           MITK_TEST_OUTPUT_NO_ENDL(<< data->GetNameOfClass());
         }
         else
         {
           MITK_TEST_OUTPUT_NO_ENDL(<< "(nullptr)");
         }
 
         MITK_TEST_OUTPUT(<< " contained in node '" << (*iter)->GetName() << "'");
         // \TODO: should we fail the test case if failed properties exist?
       }
     }
 
     failedProperties = sceneIO->GetFailedProperties();
     if (failedProperties.IsNotNull() && !failedProperties->IsEmpty())
     {
       MITK_TEST_OUTPUT(<< "The following properties could not be serialized:");
       const mitk::PropertyList::PropertyMap *propmap = failedProperties->GetMap();
       for (auto iter = propmap->begin(); iter != propmap->end(); ++iter)
       {
         MITK_TEST_OUTPUT(<< " - " << iter->second->GetNameOfClass() << " associated to key '" << iter->first << "'");
         // \TODO: should we fail the test case if failed properties exist?
       }
     }
 
     // check if data storage content has been restored correctly
     SceneIOTestClass::VerifyStorage(storage);
   }
   // if no sub-test failed remove the scene file, otherwise it is kept for debugging purposes
   if (mitk::TestManager::GetInstance()->NumberOfFailedTests() == 0)
   {
     Poco::File pocoSceneFile(sceneFileName);
     MITK_TEST_CONDITION_REQUIRED(pocoSceneFile.exists(), "Checking if scene file still exists before cleaning up.")
     pocoSceneFile.remove();
   }
   MITK_TEST_END();
 }
diff --git a/Modules/SceneSerialization/test/mitkSceneIOTest2.cpp b/Modules/SceneSerialization/test/mitkSceneIOTest2.cpp
index 3eb1a9e267..392f0477a7 100644
--- a/Modules/SceneSerialization/test/mitkSceneIOTest2.cpp
+++ b/Modules/SceneSerialization/test/mitkSceneIOTest2.cpp
@@ -1,135 +1,135 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkException.h"
 #include "mitkTestFixture.h"
 #include "mitkTestingMacros.h"
 
 #include "mitkDataStorageCompare.h"
 #include "mitkIOUtil.h"
 #include "mitkSceneIO.h"
 #include "mitkSceneIOTestScenarioProvider.h"
 
 /**
   \brief Test cases for SceneIO.
 
   Tests for SceneIO.
 
   Currently contains:
   - I/O tests: write some Storage, read it, compare
 
   Should be enhanced with:
   - tests about the interface of SceneIO, providing invalid arguments etc.
   - testing the error reporting (needs rework, however)
 
   Original notes on tests for SceneIO (topics to test, details to keep in mind, methods to use):
   (this list is a notepad that should be emptied while completing tests)
   - SaveScene interface topics:
     - all input nodes must be in storage
     - no nullptrs (in input parameters, nullptrs as nodes or data can be ok)
     - filename must be something valid
     - empty file shall be written for empty storage (?)
     - failures shall result in return false
   - LoadScene interface topics:
     - filename must exist
     - nullptr storage must be ok
     - when storage is given, it shall be returned
     - clearStorageFirst flag shall be respected
     - existing error reporting should mention failures (create faulty test scene files!)
   - Error reporting methods
     - why do they return C pointers??
     - failed properties are not meaningful, they lack association with a data node (even if it could be deduced from the
   input data storage)
     - don't test that too much, this is worth re-thinking
   - I/O tests:
     - data storage could be compared: calculate bounds, get group tags
     - reproduction of specific storage situations:
       - very long property names (empty ones possible?)
       - empty or very long node names
 
   - "historic situations", regression tests, bugs that have been discovered and fixed,
     "compatibility tess"
     - re-definition of properties to define lookup-tables in image mapper
       (gray images turn up in all colors of the rainbow)
     - re-definition of size properties from int to float in point or surface mapper
       (sizes changed)
     - such tests could be implemented as rendering tests:
       - create reference scenario manually once, store scene file and expected image in MITK-Data
         - keep data small(!)
         - describe render setups (2D cuts, 3D perspectives)? better standardize one 2D, one 3D view
       - load scene in test, render re-loaded scene, compare
 
   - (ok) Tests scenarios and comparisons should be kept out of
          this test for SceneIO because they should be re-used for
          a possible re-write!
 
 */
 class mitkSceneIOTest2Suite : public mitk::TestFixture
 {
   CPPUNIT_TEST_SUITE(mitkSceneIOTest2Suite);
   MITK_TEST(Test_SceneIOInterfaces);
   MITK_TEST(Test_ReconstructionOfScenes);
   CPPUNIT_TEST_SUITE_END();
 
   mitk::SceneIOTestScenarioProvider m_TestCaseProvider;
 
 public:
   void Test_SceneIOInterfaces() { CPPUNIT_ASSERT_MESSAGE("Not urgent", true); }
   void Test_ReconstructionOfScenes()
   {
     std::string tempDir = mitk::IOUtil::CreateTemporaryDirectory("SceneIOTest_XXXXXX");
 
     mitk::SceneIOTestScenarioProvider::ScenarioList scenarios = m_TestCaseProvider.GetAllScenarios();
     MITK_TEST_OUTPUT(<< "Executing " << scenarios.size() << " test scenarios");
-    for (auto scenario : scenarios)
+    for (const auto& scenario : scenarios)
     {
       MITK_TEST_OUTPUT(<< "\n===== Test_ReconstructionOfScenes, scenario '" << scenario.key << "' =====");
 
       std::string archiveFilename = mitk::IOUtil::CreateTemporaryFile("scene_XXXXXX.mitk", tempDir);
       mitk::SceneIO::Pointer writer = mitk::SceneIO::New();
       mitk::DataStorage::Pointer originalStorage = scenario.BuildDataStorage();
       CPPUNIT_ASSERT_MESSAGE(
         std::string("Save test scenario '") + scenario.key + "' to '" + archiveFilename + "'",
         scenario.serializable == writer->SaveScene(originalStorage->GetAll(), originalStorage, archiveFilename));
 
       if (scenario.serializable)
       {
         mitk::SceneIO::Pointer reader = mitk::SceneIO::New();
         mitk::DataStorage::Pointer restoredStorage;
         CPPUNIT_ASSERT_NO_THROW(restoredStorage = reader->LoadScene(archiveFilename));
         CPPUNIT_ASSERT_MESSAGE(
           std::string("Comparing restored test scenario '") + scenario.key + "'",
           mitk::DataStorageCompare(originalStorage,
                                    restoredStorage,
                                    // TODO make those flags part of the scenario object
                                    // TODO make known/expected failures also part of the
                                    //      scenario object (but this needs a way to describe them, first)
                                    mitk::DataStorageCompare::CMP_Hierarchy | mitk::DataStorageCompare::CMP_Data |
                                      mitk::DataStorageCompare::CMP_Properties |
                                      // mappers tested although SceneIO leaves default mappers
                                      mitk::DataStorageCompare::CMP_Mappers,
                                    // mitk::DataStorageCompare::CMP_Interactors
                                    // interactors skipped for now
                                    scenario.comparisonPrecision)
             .CompareVerbose());
       }
     }
   }
 
 }; // class
 
 int mitkSceneIOTest2(int /*argc*/, char * /*argv*/ [])
 {
   CppUnit::TextUi::TestRunner runner;
   runner.addTest(mitkSceneIOTest2Suite::suite());
   return runner.run() ? 0 : 1;
 }
diff --git a/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.cpp b/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.cpp
index acd1515c52..3006fb1a90 100644
--- a/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.cpp
+++ b/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.cpp
@@ -1,434 +1,434 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkSceneIOTestScenarioProvider.h"
 
 #include "mitkGeometryData.h"
 #include "mitkImage.h"
 #include "mitkImageGenerator.h"
 #include "mitkPointSet.h"
 #include "mitkProperties.h"
 #include "mitkSurface.h"
 
 #include <vtkCellArray.h>
 #include <vtkPolyData.h>
 #include <vtkPolygon.h>
 
 namespace
 {
   std::string VeryLongText =
     "Lorem ipsum dolor sit amet, consectetur adipiscing elit.Donec a diam lectus.Sed sit amet ipsum mauris.Maecenas "
     "congue ligula ac quam viverra nec consectetur ante hendrerit.Donec et mollis dolor.Praesent et diam eget libero "
     "egestas mattis sit amet vitae augue.Nam tincidunt congue enim, ut porta lorem lacinia consectetur.Donec ut libero "
     "sed arcu vehicula ultricies a non tortor.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Aenean ut "
     "gravida lorem.Ut turpis felis, pulvinar a semper sed, adipiscing id dolor.Pellentesque auctor nisi id magna "
     "consequat sagittis.Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet.Ut convallis "
     "libero in urna ultrices accumsan.Donec sed odio eros.Donec viverra mi quis quam pulvinar at malesuada arcu "
     "rhoncus.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.In rutrum accumsan "
     "ultricies.Mauris vitae nisi at sem facilisis semper ac in est.\n"
     "Vivamus fermentum semper porta.Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio.Maecenas "
     "convallis ullamcorper ultricies.Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id "
     "fringilla sem nunc vel mi.Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna "
     "et turpis.Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci.Fusce eget orci a orci congue "
     "vestibulum.Ut dolor diam, elementum et vestibulum eu, porttitor vel elit.Curabitur venenatis pulvinar tellus "
     "gravida ornare.Sed et erat faucibus nunc euismod ultricies ut id justo.Nullam cursus suscipit nisi, et ultrices "
     "justo sodales nec.Fusce venenatis facilisis lectus ac semper.Aliquam at massa ipsum.Quisque bibendum purus "
     "convallis nulla ultrices ultricies.Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra "
-    "pretium nisi quam vitae mi.Fusce vel volutpat elit.Nam sagittis nisi dui.\r\n"
+    "pretium nisi quam vitae mi.Fusce vel volutpat elit.Nam sagittis nisi dui.\n\n"
     "Suspendisse lectus leo, consectetur in tempor sit amet, placerat quis neque.Etiam luctus porttitor lorem, sed "
     "suscipit est rutrum non.Curabitur lobortis nisl a enim congue semper.Aenean commodo ultrices imperdiet.Vestibulum "
     "ut justo vel sapien venenatis tincidunt.Phasellus eget dolor sit amet ipsum dapibus condimentum vitae quis "
     "lectus.Aliquam ut massa in turpis dapibus convallis.Praesent elit lacus, vestibulum at malesuada et, ornare et "
     "est.Ut augue nunc, sodales ut euismod non, adipiscing vitae orci.Mauris ut placerat justo.Mauris in ultricies "
     "enim.Quisque nec est eleifend nulla ultrices egestas quis ut quam.Donec sollicitudin lectus a mauris pulvinar id "
     "aliquam urna cursus.Cras quis ligula sem, vel elementum mi.Phasellus non ullamcorper urna.\t\n"
     "Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.In euismod ultrices "
     "facilisis.Vestibulum porta sapien adipiscing augue congue id pretium lectus molestie.Proin quis dictum nisl.Morbi "
     "id quam sapien, sed vestibulum sem.Duis elementum rutrum mauris sed convallis.Proin vestibulum magna mi.Aenean "
     "tristique hendrerit magna, ac facilisis nulla hendrerit ut.Sed non tortor sodales quam auctor elementum.Donec "
     "hendrerit nunc eget elit pharetra pulvinar.Suspendisse id tempus tortor.Aenean luctus, elit commodo laoreet "
     "commodo, justo nisi consequat massa, sed vulputate quam urna quis eros.Donec vel.";
 }
 
 // --------------- SceneIOTestScenarioProvider::Scenario ---------------
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::Scenario::BuildDataStorage() const
 {
   return (*m_ScenarioProvider.*m_ProviderMethod)(); // calls function
 }
 
 mitk::SceneIOTestScenarioProvider::Scenario::Scenario(const std::string &_key,
                                                       const SceneIOTestScenarioProvider *_scenarioProvider,
                                                       SceneIOTestScenarioProvider::BuilderMethodPointer _providerMethod,
                                                       bool _isSerializable,
                                                       const std::string &_referenceArchiveFilename,
                                                       bool _isReferenceLoadable,
                                                       double _comparisonPrecision)
   : key(_key),
     serializable(_isSerializable),
     referenceArchiveFilename(_referenceArchiveFilename),
     referenceArchiveLoadable(_isReferenceLoadable),
     comparisonPrecision(_comparisonPrecision),
     m_ScenarioProvider(_scenarioProvider),
     m_ProviderMethod(_providerMethod)
 {
 }
 
 // --------------- SceneIOTestScenarioProvider ---------------
 
 mitk::SceneIOTestScenarioProvider::ScenarioList mitk::SceneIOTestScenarioProvider::GetAllScenarios() const
 {
   return m_Scenarios;
 }
 
 void mitk::SceneIOTestScenarioProvider::AddScenario(const std::string &key,
                                                     BuilderMethodPointer creator,
                                                     bool isSerializable,
                                                     const std::string &referenceArchiveFilename,
                                                     bool isReferenceLoadable,
                                                     double comparisonPrecision)
 {
   Scenario newScenario(
     key, this, creator, isSerializable, referenceArchiveFilename, isReferenceLoadable, comparisonPrecision);
   m_Scenarios.push_back(newScenario);
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::EmptyStorage() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::OneEmptyNode() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   mitk::DataNode::Pointer node = DataNode::New();
   storage->Add(node);
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::OneEmptyNamedNode() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   mitk::DataNode::Pointer node = DataNode::New();
   node->SetName("Urmel");
   storage->Add(node);
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::ManyTopLevelNodes() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   for (auto i = 0; i < m_HowMuchIsMany; ++i)
   {
     mitk::DataNode::Pointer node = DataNode::New();
     std::stringstream s;
     s << "Node #" << i;
     node->SetName(s.str());
     storage->Add(node);
   }
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::LineOfManyOnlyChildren() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   mitk::DataNode::Pointer parent;
   for (auto i = 0; i < m_HowMuchIsMany; ++i)
   {
     mitk::DataNode::Pointer node = DataNode::New();
     std::stringstream s;
     s << "Node #" << i;
     node->SetName(s.str());
     storage->Add(node, parent);
     parent = node;
   }
 
   return storage;
 }
 
 #define AddNode(name) storage->Add(name);
 
 #define DefineNode(name)                                                                                               \
   mitk::DataNode::Pointer name = mitk::DataNode::New();                                                                \
   name->SetName(#name);
 
 #define DefNode0(name) DefineNode(name) AddNode(name)
 
 #define DefNode1(source, name) DefineNode(name) storage->Add(name, source);
 
 #define DefNode2(source1, source2, name)                                                                               \
   DefineNode(name)                                                                                                     \
   {                                                                                                                    \
     mitk::DataStorage::SetOfObjects::Pointer sources = mitk::DataStorage::SetOfObjects::New();                         \
     sources->push_back(source1);                                                                                       \
     sources->push_back(source2);                                                                                       \
     storage->Add(name, sources);                                                                                       \
   }
 
 #define DefNode3(source1, source2, source3, name)                                                                      \
   DefineNode(name)                                                                                                     \
   {                                                                                                                    \
     mitk::DataStorage::SetOfObjects::Pointer sources = mitk::DataStorage::SetOfObjects::New();                         \
     sources->push_back(source1);                                                                                       \
     sources->push_back(source2);                                                                                       \
     sources->push_back(source3);                                                                                       \
     storage->Add(name, sources);                                                                                       \
   }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::ComplicatedFamilySituation() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   // constructing a hierarchy with multiple levels
   // and a couple of multiple parent relations.
 
   // Anybody, feel free to make this something
   // meaningful and/or visualize it :-)
 
   DefNode0(Color) DefNode0(White)
 
     DefNode1(Color, Green) DefNode1(Color, Election) DefNode1(Color, Red)
 
       DefNode1(Green, Yellow)
 
         DefNode1(Election, Looser) DefNode1(Election, FreeBeer) DefNode1(Election, Winner)
 
           DefNode1(Looser, Tears) DefNode1(Looser, Anger)
 
             DefNode1(FreeBeer, OpenSource);
 
   DefNode1(White, Sweet)
 
     DefNode2(White, Sweet, Sugar) DefNode2(Red, Sweet, Tomatoe) DefNode2(Tomatoe, Sugar, Ketchup)
 
       DefNode1(Ketchup, BBQSauce) DefNode1(Tomatoe, ATLAS)
 
         DefNode0(Fish) DefNode0(OperatingSystem) DefNode1(Fish, Bird) DefNode1(Bird, Penguin)
 
           DefNode3(Penguin, OperatingSystem, OpenSource, Linux)
 
             return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::Image() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   { // Image of ints
     mitk::Image::Pointer image3Dints = mitk::ImageGenerator::GenerateRandomImage<int>(10,
                                                                                       5,
                                                                                       7, // dim
                                                                                       1,
                                                                                       0.5,
                                                                                       0.5, // spacing
                                                                                       1,   // time steps
                                                                                       3000,
                                                                                       -1000); // random max / min
     mitk::DataNode::Pointer node = DataNode::New();
     node->SetName("Image-Int");
     node->SetData(image3Dints);
     storage->Add(node);
   }
 
   { // Image of doubles
     mitk::Image::Pointer image3Ddouble = mitk::ImageGenerator::GenerateRandomImage<double>(5,
                                                                                            10,
                                                                                            8, // dim
                                                                                            1,
                                                                                            0.5,
                                                                                            0.5, // spacing
                                                                                            2,   // time steps
                                                                                            3000,
                                                                                            -1000); // random max / min
     mitk::DataNode::Pointer node = DataNode::New();
     node->SetName("Image-Double");
     node->SetData(image3Ddouble);
     storage->Add(node);
   }
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::Surface() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   { // Surface
     vtkSmartPointer<vtkPoints> points1 = vtkSmartPointer<vtkPoints>::New();
     points1->InsertNextPoint(0.0, 0.0, 0.0);
     points1->InsertNextPoint(1.0, 0.0, 0.0);
     points1->InsertNextPoint(0.0, 1.0, 0.0);
     points1->InsertNextPoint(1.0, 1.0, 0.0);
 
     vtkSmartPointer<vtkPolygon> polygon1 = vtkSmartPointer<vtkPolygon>::New();
     polygon1->GetPointIds()->SetNumberOfIds(4);
     polygon1->GetPointIds()->SetId(0, 0);
     polygon1->GetPointIds()->SetId(1, 1);
     polygon1->GetPointIds()->SetId(2, 2);
     polygon1->GetPointIds()->SetId(3, 3);
 
     vtkSmartPointer<vtkPolygon> polygon2 = vtkSmartPointer<vtkPolygon>::New();
     polygon2->GetPointIds()->SetNumberOfIds(4);
     polygon2->GetPointIds()->SetId(0, 3);
     polygon2->GetPointIds()->SetId(1, 2);
     polygon2->GetPointIds()->SetId(2, 0);
     polygon2->GetPointIds()->SetId(3, 1);
 
     // generate polydatas
     vtkSmartPointer<vtkCellArray> polygonArray1 = vtkSmartPointer<vtkCellArray>::New();
     polygonArray1->InsertNextCell(polygon1);
 
     vtkSmartPointer<vtkPolyData> polydata1 = vtkSmartPointer<vtkPolyData>::New();
     polydata1->SetPoints(points1);
     polydata1->SetPolys(polygonArray1);
 
     vtkSmartPointer<vtkCellArray> polygonArray2 = vtkSmartPointer<vtkCellArray>::New();
     polygonArray2->InsertNextCell(polygon2);
 
     vtkSmartPointer<vtkPolyData> polyDataTwo = vtkSmartPointer<vtkPolyData>::New();
     polyDataTwo->SetPoints(points1);
     polyDataTwo->SetPolys(polygonArray2);
 
     // generate surfaces
     mitk::Surface::Pointer surface = mitk::Surface::New();
     surface->SetVtkPolyData(polydata1);
 
     mitk::DataNode::Pointer node = DataNode::New();
     node->SetName("Surface");
     node->SetData(surface);
     storage->Add(node);
   }
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::PointSet() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   { // PointSet
     mitk::PointSet::Pointer ps = mitk::PointSet::New();
     mitk::PointSet::PointType p;
     mitk::FillVector3D(p, 1.0, -2.0, 33.0);
     ps->SetPoint(0, p);
     mitk::FillVector3D(p, 100.0, -200.0, 3300.0);
     ps->SetPoint(1, p);
     mitk::FillVector3D(p, 2.0, -3.0, 22.0);
     ps->SetPoint(2, p, mitk::PTCORNER); // add point spec
 
     mitk::DataNode::Pointer node = DataNode::New();
     node->SetName("PointSet");
     node->SetData(ps);
     storage->Add(node);
   }
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::GeometryData() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   { // GeometryData
     mitk::GeometryData::Pointer gdata = mitk::GeometryData::New();
 
     // define Geometry3D parameters
     mitk::AffineTransform3D::MatrixType matrix;
     matrix[0][0] = 1.1;
     matrix[1][1] = 2.2;
     matrix[2][2] = 3.3;
     mitk::AffineTransform3D::OffsetType offset;
     mitk::FillVector3D(offset, 0.1, 0.2, 0.3);
     bool isImageGeometry(false);
     unsigned int frameOfReferenceID(47);
 
     mitk::BaseGeometry::BoundsArrayType bounds;
     bounds[0] = std::numeric_limits<mitk::ScalarType>::min();
     bounds[1] = -52.723;
     bounds[2] = -0.002;
     bounds[3] = 918273645.18293746;
     bounds[4] = -0.002;
     bounds[5] = +52.723;
 
     mitk::Point3D origin;
     mitk::FillVector3D(origin, 5.1, 5.2, 5.3);
     mitk::Vector3D spacing;
     mitk::FillVector3D(spacing, 2.1, 2.2, 2.3);
 
     // build GeometryData from matrix/offset/etc.
     mitk::AffineTransform3D::Pointer newTransform = mitk::AffineTransform3D::New();
     newTransform->SetMatrix(matrix);
     newTransform->SetOffset(offset);
 
     mitk::Geometry3D::Pointer newGeometry = mitk::Geometry3D::New();
     newGeometry->SetFrameOfReferenceID(frameOfReferenceID);
     newGeometry->SetImageGeometry(isImageGeometry);
 
     newGeometry->SetIndexToWorldTransform(newTransform);
 
     newGeometry->SetBounds(bounds);
     newGeometry->SetOrigin(origin);
     newGeometry->SetSpacing(spacing);
 
     mitk::GeometryData::Pointer geometryData = mitk::GeometryData::New();
     geometryData->SetGeometry(newGeometry);
 
     mitk::DataNode::Pointer node = DataNode::New();
     node->SetName("GeometryData");
     node->SetData(geometryData);
     storage->Add(node);
   }
 
   return storage;
 }
 
 mitk::DataStorage::Pointer mitk::SceneIOTestScenarioProvider::SpecialProperties() const
 {
   mitk::DataStorage::Pointer storage = StandaloneDataStorage::New().GetPointer();
 
   mitk::DataNode::Pointer node = DataNode::New();
   node->SetName("Camion");
 
   node->SetProperty("Livre", StringProperty::New(VeryLongText)); // defined at the top of this file
   node->SetProperty(VeryLongText.c_str(), StringProperty::New("Shorty"));
 
   node->GetPropertyList("Chapitre1")->SetProperty("Page 1", StringProperty::New(VeryLongText));
   node->GetPropertyList("Chapitre1")->SetProperty("Page 2", StringProperty::New(VeryLongText));
   node->GetPropertyList("Chapitre 2")->SetProperty("Page", StringProperty::New(VeryLongText));
   node->GetPropertyList("Chapitre 3")->SetProperty("Page", StringProperty::New(VeryLongText));
   node->GetPropertyList(VeryLongText)->SetProperty("Page", StringProperty::New(VeryLongText));
 
   // not working (NaN etc.)
   // node->SetProperty("NotAFloat", FloatProperty::New( sqrt(-1.0) ) );
   node->SetProperty("sqrt(2)", FloatProperty::New(-sqrt(2.0)));
   node->SetProperty("sqrt(3)", FloatProperty::New(sqrt(3.0)));
 
   // most values work fine, just min/max double produces serialization precision errors
   node->SetProperty("sqrt(4)", DoubleProperty::New(-sqrt(4.0)));
   node->SetProperty("sqrt(5)", DoubleProperty::New(sqrt(5.0)));
   // node->SetProperty("maxd", DoubleProperty::New( std::numeric_limits<double>::max() ) );
   node->SetProperty("zero", DoubleProperty::New(0.0));
   node->SetProperty("minzero", DoubleProperty::New(-0.0));
   // node->SetProperty("mind", DoubleProperty::New( std::numeric_limits<double>::min() ) );
 
   storage->Add(node);
 
   return storage;
 }
diff --git a/Modules/SceneSerializationBase/CMakeLists.txt b/Modules/SceneSerializationBase/CMakeLists.txt
index 95aa6b358a..b27950475d 100644
--- a/Modules/SceneSerializationBase/CMakeLists.txt
+++ b/Modules/SceneSerializationBase/CMakeLists.txt
@@ -1,6 +1,11 @@
 MITK_CREATE_MODULE(
   DEPENDS MitkCore
-  PACKAGE_DEPENDS PUBLIC tinyxml
+  PACKAGE_DEPENDS PUBLIC tinyxml2|tinyxml2
 )
+
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET} PUBLIC tinyxml2::tinyxml2)
+endif()
+
 add_subdirectory(test)
 
diff --git a/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h b/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
index adb01cdaa0..90ba831bbb 100644
--- a/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
@@ -1,70 +1,74 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkSerializeBaseProperty_h_included
 #define mitkSerializeBaseProperty_h_included
 
 #include "mitkSerializerMacros.h"
 #include <MitkSceneSerializationBaseExports.h>
 
 #include "mitkBaseProperty.h"
 #include <itkObjectFactoryBase.h>
 
-#include <tinyxml.h>
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
     \brief Base class for objects that serialize BaseProperty types.
 
     The name of sub-classes must be deduced from the class name of the object that should be serialized.
     The serialization assumes that
 
     \verbatim
     If the class derived from BaseProperty is called GreenProperty
     Then the serializer for this class must be called GreenPropertySerializer
     \endverbatim
   */
   class MITKSCENESERIALIZATIONBASE_EXPORT BasePropertySerializer : public itk::Object
   {
   public:
     mitkClassMacroItkParent(BasePropertySerializer, itk::Object);
 
     itkSetConstObjectMacro(Property, BaseProperty);
 
     /**
       \brief Serializes given BaseProperty object.
       \return The filename of the newly created file.
 
       This should be overwritten by specific sub-classes.
     */
-    virtual TiXmlElement *Serialize();
+    virtual tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc);
 
     /**
-      \brief Deserializes given TiXmlElement.
+      \brief Deserializes given XML element.
       \return The deserialized Property.
 
       This should be overwritten by specific sub-classes.
     */
 
-    virtual BaseProperty::Pointer Deserialize(TiXmlElement *);
+    virtual BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement*);
 
   protected:
     BasePropertySerializer();
     ~BasePropertySerializer() override;
 
     BaseProperty::ConstPointer m_Property;
   };
 
 } // namespace
 
 #endif
diff --git a/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
index 6ac8da4ca9..16d740f2cf 100644
--- a/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
@@ -1,36 +1,36 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkEnumerationPropertySerializer_h_included
 #define mitkEnumerationPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkEnumerationProperty.h"
 
 namespace mitk
 {
   class MITKSCENESERIALIZATIONBASE_EXPORT EnumerationPropertySerializer : public BasePropertySerializer
   {
   public:
     mitkClassMacro(EnumerationPropertySerializer, BasePropertySerializer);
 
-    TiXmlElement *Serialize() override;
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc) override;
 
   protected:
     EnumerationPropertySerializer();
     ~EnumerationPropertySerializer() override;
   };
 
 } // namespace
 
 #endif
diff --git a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
index 59588423fc..dac01cbcf1 100644
--- a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
@@ -1,57 +1,57 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkLookupTablePropertySerializer_h_included
 #define mitkLookupTablePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include <MitkSceneSerializationBaseExports.h>
 
 namespace mitk
 {
   /**
   \brief Base class for objects that serialize BaseData types.
 
   The name of sub-classes must be deduced from the class name of the object that should be serialized.
   The serialization assumes that
 
   \verbatim
   If the class derived from BaseData is called GreenData
   Then the serializer for this class must be called GreenDataSerializer
   \endverbatim
    */
   class MITKSCENESERIALIZATIONBASE_EXPORT LookupTablePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(LookupTablePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self);
-    itkCloneMacro(Self);
+    mitkClassMacro(LookupTablePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      /**
-        \brief Serializes given BaseData object.
-        \return the filename of the newly created file.
+    /**
+      \brief Serializes given BaseData object.
+      \return the filename of the newly created file.
 
-        This should be overwritten by specific sub-classes.
-       */
-      TiXmlElement *Serialize() override;
+      This should be overwritten by specific sub-classes.
+      */
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc) override;
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override;
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override;
 
   protected:
     LookupTablePropertySerializer(){};
     ~LookupTablePropertySerializer() override{};
   };
 }
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(LookupTablePropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
index ffafeff700..360847a7db 100644
--- a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
@@ -1,66 +1,70 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkPropertyListSerializer_h_included
 #define mitkPropertyListSerializer_h_included
 
 #include <MitkSceneSerializationBaseExports.h>
 
 #include "mitkPropertyList.h"
 
 #include <itkObjectFactoryBase.h>
 
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk
 {
   /**
     \brief Serializes a mitk::PropertyList
   */
   class MITKSCENESERIALIZATIONBASE_EXPORT PropertyListSerializer : public itk::Object
   {
   public:
     mitkClassMacroItkParent(PropertyListSerializer, itk::Object);
     itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
       itkCloneMacro(Self);
       itkSetStringMacro(FilenameHint);
     itkGetStringMacro(FilenameHint);
 
     itkSetStringMacro(WorkingDirectory);
     itkGetStringMacro(WorkingDirectory);
 
     itkSetObjectMacro(PropertyList, PropertyList);
 
     /**
       \brief Serializes given PropertyList object.
       \return the filename of the newly created file.
       */
     virtual std::string Serialize();
 
     PropertyList *GetFailedProperties();
 
   protected:
     PropertyListSerializer();
     ~PropertyListSerializer() override;
 
-    TiXmlElement *SerializeOneProperty(const std::string &key, const BaseProperty *property);
+    tinyxml2::XMLElement *SerializeOneProperty(tinyxml2::XMLDocument &doc, const std::string &key, const BaseProperty *property);
 
     std::string m_FilenameHint;
     std::string m_WorkingDirectory;
     PropertyList::Pointer m_PropertyList;
 
     PropertyList::Pointer m_FailedProperties;
   };
 
 } // namespace
 
 #endif
diff --git a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
index 786185df13..c064dac33a 100644
--- a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
@@ -1,35 +1,35 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkTransferFunctionProperty.h"
 
 namespace mitk
 {
   class MITKSCENESERIALIZATIONBASE_EXPORT TransferFunctionPropertySerializer : public BasePropertySerializer
   {
   public:
     mitkClassMacro(TransferFunctionPropertySerializer, BasePropertySerializer);
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
-      TiXmlElement *Serialize() override;
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override;
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override;
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override;
 
     static bool SerializeTransferFunction(const char *filename, TransferFunction::Pointer tf);
     static TransferFunction::Pointer DeserializeTransferFunction(const char *filePath);
 
   protected:
     TransferFunctionPropertySerializer();
     ~TransferFunctionPropertySerializer() override;
   };
 } // namespace
diff --git a/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
index 72cf35e431..a2710f1d7b 100644
--- a/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkVectorPropertySerializer.h
@@ -1,153 +1,153 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkVectorPropertySerializer_h
 #define mitkVectorPropertySerializer_h
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkVectorProperty.h"
-
 #include <mitkLexicalCast.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   /**
     \brief Serializes a VectorProperty
 
     Serializes an instance of VectorProperty into a XML structure like
 
     \verbatim
     <Values>
       <Value idx="0" value="17.3"/>
       <Value idx="1" value="7.2"/>
       <Value idx="2" value="-17.3"/>
     </Values>
     \endverbatim
 
     This class is implemented as a template and makes use of std::stringstream
     for necessary conversions of specific data types to and from string.
 
     For numeric types, the class adds a precision token to stringstream that
     should usually suffice.
   */
   template <typename DATATYPE>
   class MITKSCENESERIALIZATIONBASE_EXPORT VectorPropertySerializer : public BasePropertySerializer
   {
   public:
     // Expand manually most of mitkClassMacro:
     // mitkClassMacro(VectorProperty<DATATYPE>, mitk::BaseProperty);
     // This manual expansion is done to override explicitely
     // the GetNameOfClass methods
     typedef VectorProperty<DATATYPE> PropertyType;
     typedef VectorPropertySerializer<DATATYPE> Self;
     typedef BasePropertySerializer SuperClass;
     typedef itk::SmartPointer<Self> Pointer;
     typedef itk::SmartPointer<const Self> ConstPointer;
     std::vector<std::string> GetClassHierarchy() const override { return mitk::GetClassHierarchy<Self>(); }
     // This function must return different
     // strings in function of the template parameter!
     // Serialization depends on this feature.
     static const char *GetStaticNameOfClass()
     {
       // concatenate a prefix dependent on the template type and our own classname
       static std::string nameOfClass =
         std::string(VectorPropertyDataType<DATATYPE>::prefix()) + "VectorPropertySerializer";
       return nameOfClass.c_str();
     }
 
     const char *GetNameOfClass() const override { return this->GetStaticNameOfClass(); }
     itkFactorylessNewMacro(Self);
     itkCloneMacro(Self);
 
-      //! Build an XML version of this property
-      TiXmlElement *Serialize() override
+    //! Build an XML version of this property
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
-      auto listElement = new TiXmlElement("Values");
+      auto *listElement = doc.NewElement("Values");
 
       if (const PropertyType *prop = dynamic_cast<const PropertyType *>(m_Property.GetPointer()))
       {
         typename PropertyType::VectorType elements = prop->GetValue();
         unsigned int index(0);
         for (auto listEntry : elements)
         {
           std::stringstream indexS;
           indexS << index++;
 
-          auto entryElement = new TiXmlElement("Value");
-          entryElement->SetAttribute("idx", indexS.str());
-          entryElement->SetAttribute("value", boost::lexical_cast<std::string>(listEntry));
-          listElement->LinkEndChild(entryElement);
+          auto *entryElement = doc.NewElement("Value");
+          entryElement->SetAttribute("idx", indexS.str().c_str());
+          entryElement->SetAttribute("value", boost::lexical_cast<std::string>(listEntry).c_str());
+          listElement->InsertEndChild(entryElement);
         }
 
         return listElement;
       }
       else
       {
         return nullptr;
       }
     }
 
     //! Construct a property from an XML serialization
-    BaseProperty::Pointer Deserialize(TiXmlElement *listElement) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *listElement) override
     {
       typename PropertyType::VectorType datalist;
 
       if (listElement)
       {
         MITK_DEBUG << "Deserializing " << *listElement;
 
         unsigned int index(0);
         std::string valueString;
         DATATYPE value;
-        for (TiXmlElement *valueElement = listElement->FirstChildElement("Value"); valueElement;
+        for (auto *valueElement = listElement->FirstChildElement("Value"); valueElement;
              valueElement = valueElement->NextSiblingElement("Value"))
         {
-          if (valueElement->QueryValueAttribute("value", &valueString) != TIXML_SUCCESS)
+          valueString = valueElement->Attribute("value");
+          if (valueString.empty())
           {
             MITK_ERROR << "Missing value attribute in <Values> list";
             return nullptr;
           }
 
           try
           {
             value = boost::lexical_cast<DATATYPE>(valueString);
           }
           catch (boost::bad_lexical_cast &e)
           {
             MITK_ERROR << "Could not parse '" << valueString << "' as number: " << e.what();
             return nullptr;
           }
 
           datalist.push_back(value);
           ++index;
         }
 
         typename PropertyType::Pointer property = PropertyType::New();
         property->SetValue(datalist);
         return property.GetPointer();
       }
       else
       {
         MITK_ERROR << "Missing <Values> tag.";
       }
 
       return nullptr;
     }
   };
 
   typedef VectorPropertySerializer<double> DoubleVectorPropertySerializer;
   typedef VectorPropertySerializer<int> IntVectorPropertySerializer;
 
 } // namespace
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkAnnotationPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkAnnotationPropertySerializer.cpp
index 9368dae2fe..0e1a0b02ac 100644
--- a/Modules/SceneSerializationBase/src/mitkAnnotationPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkAnnotationPropertySerializer.cpp
@@ -1,81 +1,86 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkAnnotationPropertySerializer_h_included
 #define mitkAnnotationPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkAnnotationProperty.h"
 #include "mitkStringsToNumbers.h"
 
+#include <array>
+
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class AnnotationPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(AnnotationPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(AnnotationPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const AnnotationProperty *prop = dynamic_cast<const AnnotationProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("annotation");
+        auto *element = doc.NewElement("annotation");
         element->SetAttribute("label", prop->GetLabel());
         Point3D point = prop->GetPosition();
-        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]));
-        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]));
-        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]));
+        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]).c_str());
+        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]).c_str());
+        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
       const char *label(element->Attribute("label"));
-      std::string p_string[3];
-      if (element->QueryStringAttribute("x", &p_string[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("y", &p_string[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("z", &p_string[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> p_string = {
+        element->Attribute("x"),
+        element->Attribute("y"),
+        element->Attribute("z")
+      };
+      if (nullptr == p_string[0] || nullptr == p_string[1] || nullptr == p_string[2])
         return nullptr;
       Point3D p;
       try
       {
         StringsToNumbers<double>(3, p_string, p);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
 
       return AnnotationProperty::New(label, p).GetPointer();
     }
 
   protected:
     AnnotationPropertySerializer() {}
     ~AnnotationPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(AnnotationPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkBasePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkBasePropertySerializer.cpp
index a21cf2889f..de4e87e393 100644
--- a/Modules/SceneSerializationBase/src/mitkBasePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkBasePropertySerializer.cpp
@@ -1,34 +1,33 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkBasePropertySerializer.h"
 
 mitk::BasePropertySerializer::BasePropertySerializer()
 {
 }
 
 mitk::BasePropertySerializer::~BasePropertySerializer()
 {
 }
 
-TiXmlElement *mitk::BasePropertySerializer::Serialize()
+tinyxml2::XMLElement *mitk::BasePropertySerializer::Serialize(tinyxml2::XMLDocument&)
 {
   MITK_INFO << this->GetNameOfClass() << " is asked to serialize an object " << (const void *)this->m_Property;
-
   return nullptr;
 }
 
-mitk::BaseProperty::Pointer mitk::BasePropertySerializer::Deserialize(TiXmlElement *)
+mitk::BaseProperty::Pointer mitk::BasePropertySerializer::Deserialize(const tinyxml2::XMLElement *)
 {
   MITK_ERROR << this->GetNameOfClass() << " is asked to deserialize an object but has no implementation. This is bad.";
   return nullptr;
 }
diff --git a/Modules/SceneSerializationBase/src/mitkBoolLookupTablePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkBoolLookupTablePropertySerializer.cpp
index 59b9edc80e..eb60909922 100644
--- a/Modules/SceneSerializationBase/src/mitkBoolLookupTablePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkBoolLookupTablePropertySerializer.cpp
@@ -1,78 +1,78 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkBoolLookupTablePropertySerializer_h_included
 #define mitkBoolLookupTablePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkProperties.h"
 
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class BoolLookupTablePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(BoolLookupTablePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(BoolLookupTablePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       const BoolLookupTableProperty *prop = dynamic_cast<const BoolLookupTableProperty *>(m_Property.GetPointer());
       if (prop == nullptr)
         return nullptr;
       BoolLookupTable lut = prop->GetValue();
       // if (lut.IsNull())
       //  return nullptr; // really?
       const BoolLookupTable::LookupTableType &map = lut.GetLookupTable();
 
-      auto element = new TiXmlElement("BoolLookupTable");
+      auto *element = doc.NewElement("BoolLookupTable");
       for (auto it = map.begin(); it != map.end(); ++it)
       {
-        auto tableEntry = new TiXmlElement("LUTValue");
+        auto *tableEntry = doc.NewElement("LUTValue");
         tableEntry->SetAttribute("id", it->first);
-        if (it->second == true)
-          tableEntry->SetAttribute("value", "true");
-        else
-          tableEntry->SetAttribute("value", "false");
-        element->LinkEndChild(tableEntry);
+        tableEntry->SetAttribute("value", it->second);
+        element->InsertEndChild(tableEntry);
       }
       return element;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       BoolLookupTable lut;
-      for (TiXmlElement *child = element->FirstChildElement("LUTValue"); child != nullptr;
+      for (auto *child = element->FirstChildElement("LUTValue"); child != nullptr;
            child = child->NextSiblingElement("LUTValue"))
       {
         int xmlID;
-        if (child->QueryIntAttribute("id", &xmlID) == TIXML_WRONG_TYPE)
+        if (child->QueryIntAttribute("id", &xmlID) != tinyxml2::XML_SUCCESS)
           return nullptr; // TODO: can we do a better error handling?
         BoolLookupTable::IdentifierType id = static_cast<BoolLookupTable::IdentifierType>(xmlID);
         BoolLookupTable::ValueType val = std::string(child->Attribute("value")) == std::string("true");
         lut.SetTableValue(id, val);
       }
       return BoolLookupTableProperty::New(lut).GetPointer();
     }
 
   protected:
     BoolLookupTablePropertySerializer() {}
     ~BoolLookupTablePropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(BoolLookupTablePropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkBoolPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkBoolPropertySerializer.cpp
index 15da786146..f8e1fc5b32 100644
--- a/Modules/SceneSerializationBase/src/mitkBoolPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkBoolPropertySerializer.cpp
@@ -1,64 +1,58 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkBoolPropertySerializer_h_included
 #define mitkBoolPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class BoolPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(BoolPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(BoolPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const BoolProperty *prop = dynamic_cast<const BoolProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("bool");
-        if (prop->GetValue() == true)
-        {
-          element->SetAttribute("value", "true");
-        }
-        else
-        {
-          element->SetAttribute("value", "false");
-        }
+        auto element = doc.NewElement("bool");
+        element->SetAttribute("value", prop->GetValue());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
       return BoolProperty::New(std::string(element->Attribute("value")) == "true").GetPointer();
     }
 
   protected:
     BoolPropertySerializer() {}
     ~BoolPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(BoolPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkClippingPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkClippingPropertySerializer.cpp
index b19fbdb76d..8c9f84f962 100644
--- a/Modules/SceneSerializationBase/src/mitkClippingPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkClippingPropertySerializer.cpp
@@ -1,123 +1,125 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkClippingPropertySerializer_h_included
 #define mitkClippingPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkClippingProperty.h"
 #include "mitkNumericTypes.h"
 #include <mitkLocaleSwitch.h>
 
 #include "mitkStringsToNumbers.h"
 
+#include <array>
+
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class ClippingPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(ClippingPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(ClippingPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const ClippingProperty *prop = dynamic_cast<const ClippingProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("clipping");
-        if (prop->GetClippingEnabled())
-          element->SetAttribute("enabled", "true");
-        else
-          element->SetAttribute("enabled", "false");
-        auto originElement = new TiXmlElement("origin");
+        auto *element = doc.NewElement("clipping");
+        element->SetAttribute("enabled", prop->GetClippingEnabled());
+        auto *originElement = doc.NewElement("origin");
         const Point3D origin = prop->GetOrigin();
-        originElement->SetAttribute("x", boost::lexical_cast<std::string>(origin[0]));
-        originElement->SetAttribute("y", boost::lexical_cast<std::string>(origin[1]));
-        originElement->SetAttribute("z", boost::lexical_cast<std::string>(origin[2]));
-        element->LinkEndChild(originElement);
-        auto normalElement = new TiXmlElement("normal");
+        originElement->SetAttribute("x", boost::lexical_cast<std::string>(origin[0]).c_str());
+        originElement->SetAttribute("y", boost::lexical_cast<std::string>(origin[1]).c_str());
+        originElement->SetAttribute("z", boost::lexical_cast<std::string>(origin[2]).c_str());
+        element->InsertEndChild(originElement);
+        auto *normalElement = doc.NewElement("normal");
         const Vector3D normal = prop->GetNormal();
-        normalElement->SetAttribute("x", boost::lexical_cast<std::string>(normal[0]));
-        normalElement->SetAttribute("y", boost::lexical_cast<std::string>(normal[1]));
-        normalElement->SetAttribute("z", boost::lexical_cast<std::string>(normal[2]));
-        element->LinkEndChild(normalElement);
+        normalElement->SetAttribute("x", boost::lexical_cast<std::string>(normal[0]).c_str());
+        normalElement->SetAttribute("y", boost::lexical_cast<std::string>(normal[1]).c_str());
+        normalElement->SetAttribute("z", boost::lexical_cast<std::string>(normal[2]).c_str());
+        element->InsertEndChild(normalElement);
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
       bool enabled = std::string(element->Attribute("enabled")) == "true";
 
-      TiXmlElement *originElement = element->FirstChildElement("origin");
+      auto *originElement = element->FirstChildElement("origin");
       if (originElement == nullptr)
         return nullptr;
-      std::string origin_string[3];
-      if (originElement->QueryStringAttribute("x", &origin_string[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (originElement->QueryStringAttribute("y", &origin_string[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (originElement->QueryStringAttribute("z", &origin_string[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> origin_string = {
+        originElement->Attribute("x"),
+        originElement->Attribute("y"),
+        originElement->Attribute("z")
+      };
+      if (nullptr == origin_string[0] || nullptr == origin_string[1] || nullptr == origin_string[2])
         return nullptr;
       Point3D origin;
       try
       {
         StringsToNumbers<ScalarType>(3, origin_string, origin);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
 
-      TiXmlElement *normalElement = element->FirstChildElement("normal");
+      auto *normalElement = element->FirstChildElement("normal");
       if (normalElement == nullptr)
         return nullptr;
-      std::string normal_string[3];
-      if (normalElement->QueryStringAttribute("x", &normal_string[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (normalElement->QueryStringAttribute("y", &normal_string[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (normalElement->QueryStringAttribute("z", &normal_string[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> normal_string = {
+        normalElement->Attribute("x"),
+        normalElement->Attribute("y"),
+        normalElement->Attribute("z")
+      };
+      if (nullptr == normal_string[0] || nullptr == normal_string[1] || nullptr == normal_string[2])
         return nullptr;
       Vector3D normal;
       try
       {
         StringsToNumbers<ScalarType>(3, normal_string, normal);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
 
       ClippingProperty::Pointer cp = ClippingProperty::New(origin, normal);
       cp->SetClippingEnabled(enabled);
       return cp.GetPointer();
     }
 
   protected:
     ClippingPropertySerializer() {}
     ~ClippingPropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(ClippingPropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkColorPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkColorPropertySerializer.cpp
index cda935b87b..ab3bf11493 100644
--- a/Modules/SceneSerializationBase/src/mitkColorPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkColorPropertySerializer.cpp
@@ -1,84 +1,91 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkColorPropertySerializer_h_included
 #define mitkColorPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkColorProperty.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
 
+#include <array>
+
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class ColorPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(ColorPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(ColorPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const ColorProperty *prop = dynamic_cast<const ColorProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("color");
+        auto *element = doc.NewElement("color");
         Color color = prop->GetValue();
-        element->SetAttribute("r", boost::lexical_cast<std::string>(color[0]));
-        element->SetAttribute("g", boost::lexical_cast<std::string>(color[1]));
-        element->SetAttribute("b", boost::lexical_cast<std::string>(color[2]));
+        element->SetAttribute("r", boost::lexical_cast<std::string>(color[0]).c_str());
+        element->SetAttribute("g", boost::lexical_cast<std::string>(color[1]).c_str());
+        element->SetAttribute("b", boost::lexical_cast<std::string>(color[2]).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string c_string[3];
-      if (element->QueryStringAttribute("r", &c_string[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("g", &c_string[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("b", &c_string[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> c_string = {
+        element->Attribute("r"),
+        element->Attribute("g"),
+        element->Attribute("b")
+      };
+      
+      if (nullptr == c_string[0] || nullptr == c_string[1] || nullptr == c_string[2])
         return nullptr;
+
       Color c;
       try
       {
         StringsToNumbers<double>(3, c_string, c);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
 
       return ColorProperty::New(c).GetPointer();
     }
 
   protected:
     ColorPropertySerializer() {}
     ~ColorPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(ColorPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkDoublePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkDoublePropertySerializer.cpp
index b5b2255f66..c1622d4c02 100644
--- a/Modules/SceneSerializationBase/src/mitkDoublePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkDoublePropertySerializer.cpp
@@ -1,83 +1,86 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkDoublePropertySerializer_h_included
 #define mitkDoublePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkProperties.h"
 #include <mitkLexicalCast.h>
 
 #include <MitkSceneSerializationBaseExports.h>
 
 #include <mitkLocaleSwitch.h>
 
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class DoublePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(DoublePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(DoublePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       if (const DoubleProperty *prop = dynamic_cast<const DoubleProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("double");
-        element->SetAttribute("value", boost::lexical_cast<std::string>(prop->GetValue()));
+        auto *element = doc.NewElement("double");
+        element->SetAttribute("value", boost::lexical_cast<std::string>(prop->GetValue()).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string d;
-      if (element->QueryStringAttribute("value", &d) == TIXML_SUCCESS)
+      const char* d = element->Attribute("value");
+      if (nullptr != d)
       {
         try
         {
           return DoubleProperty::New(boost::lexical_cast<double>(d)).GetPointer();
         }
         catch (boost::bad_lexical_cast &e)
         {
           MITK_ERROR << "Could not parse string as number: " << e.what();
           return nullptr;
         }
       }
       else
       {
         return nullptr;
       }
     }
 
   protected:
     DoublePropertySerializer() {}
     ~DoublePropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(DoublePropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkEnumerationPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkEnumerationPropertySerializer.cpp
index 6ef0107dc6..c5d0ebde3d 100644
--- a/Modules/SceneSerializationBase/src/mitkEnumerationPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkEnumerationPropertySerializer.cpp
@@ -1,34 +1,35 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkEnumerationPropertySerializer.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
-  TiXmlElement *EnumerationPropertySerializer::Serialize()
+  tinyxml2::XMLElement *EnumerationPropertySerializer::Serialize(tinyxml2::XMLDocument &doc)
   {
     if (const auto *prop = dynamic_cast<const EnumerationProperty *>(m_Property.GetPointer()))
     {
-      auto element = new TiXmlElement("enum");
-      element->SetAttribute("value", prop->GetValueAsString());
+      auto element = doc.NewElement("enum");
+      element->SetAttribute("value", prop->GetValueAsString().c_str());
       return element;
     }
     else
       return nullptr;
   }
 
   EnumerationPropertySerializer::EnumerationPropertySerializer() {}
   EnumerationPropertySerializer::~EnumerationPropertySerializer() {}
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(EnumerationPropertySerializer);
diff --git a/Modules/SceneSerializationBase/src/mitkEnumerationSubclassesSerializer.cpp b/Modules/SceneSerializationBase/src/mitkEnumerationSubclassesSerializer.cpp
index 518f2d1177..700de1d768 100644
--- a/Modules/SceneSerializationBase/src/mitkEnumerationSubclassesSerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkEnumerationSubclassesSerializer.cpp
@@ -1,72 +1,70 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkEnumerationSubclassesSerializer_h_included
 #define mitkEnumerationSubclassesSerializer_h_included
 
 #include "mitkEnumerationPropertySerializer.h"
 
 #include "mitkModalityProperty.h"
 #include "mitkPlaneOrientationProperty.h"
 #include "mitkPointSetShapeProperty.h"
 #include "mitkRenderingModeProperty.h"
 #include "mitkVtkInterpolationProperty.h"
 #include "mitkVtkRepresentationProperty.h"
 #include "mitkVtkResliceInterpolationProperty.h"
 #include "mitkVtkScalarModeProperty.h"
 #include "mitkVtkVolumeRenderingProperty.h"
 
-#define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname)                                                                   \
-  \
-namespace mitk                                                                                                         \
-  \
-{                                                                                                                 \
-    \
-class classname##Serializer                                                                                            \
-      : public EnumerationPropertySerializer\
-{public :                                                                                                              \
-                                                                                                                       \
-          mitkClassMacro(classname##Serializer, EnumerationPropertySerializer) itkFactorylessNewMacro(Self)            \
-            itkCloneMacro(Self)                                                                                        \
-                                                                                                                       \
-              virtual BaseProperty::Pointer Deserialize(TiXmlElement * element) override{if (!element) return nullptr;    \
-    const char *sa(element->Attribute("value"));                                                                       \
-                                                                                                                       \
-    std::string s(sa ? sa : "");                                                                                       \
-    classname::Pointer property = classname::New();                                                                    \
-    property->SetValue(s);                                                                                             \
-                                                                                                                       \
-    return property.GetPointer();                                                                                      \
-  }                                                                                                                    \
-                                                                                                                       \
-protected:                                                                                                             \
-  classname##Serializer() {}                                                                                           \
-  virtual ~classname##Serializer() {}                                                                                  \
-  \
-}                                                                                                                 \
-  ;                                                                                                                    \
-  \
-}                                                                                                                 \
-  \
+#include <tinyxml2.h>
+
+#define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname)                                        \
+                                                                                            \
+namespace mitk                                                                              \
+{                                                                                           \
+  class classname##Serializer : public EnumerationPropertySerializer                        \
+  {                                                                                         \
+  public:                                                                                   \
+    mitkClassMacro(classname##Serializer, EnumerationPropertySerializer)                    \
+    itkFactorylessNewMacro(Self)                                                            \
+    itkCloneMacro(Self)                                                                     \
+                                                                                            \
+    virtual BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override \
+    {                                                                                       \
+      if (nullptr == element)                                                               \
+        return nullptr;                                                                     \
+                                                                                            \
+      classname::Pointer property = classname::New();                                       \
+      property->SetValue(element->Attribute("value"));                                      \
+                                                                                            \
+      return property.GetPointer();                                                         \
+  }                                                                                         \
+                                                                                            \
+  protected:                                                                                \
+    classname##Serializer() {}                                                              \
+    virtual ~classname##Serializer() {}                                                     \
+  };                                                                                        \
+}                                                                                           \
+                                                                                            \
 MITK_REGISTER_SERIALIZER(classname##Serializer);
 
 MITK_REGISTER_ENUM_SUB_SERIALIZER(PlaneOrientationProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(VtkInterpolationProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(VtkRepresentationProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(VtkResliceInterpolationProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(VtkScalarModeProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(VtkVolumeRenderingProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(ModalityProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(RenderingModeProperty);
 MITK_REGISTER_ENUM_SUB_SERIALIZER(PointSetShapeProperty);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkFloatLookupTablePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkFloatLookupTablePropertySerializer.cpp
index 935b93e661..29e72ea720 100644
--- a/Modules/SceneSerializationBase/src/mitkFloatLookupTablePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkFloatLookupTablePropertySerializer.cpp
@@ -1,91 +1,93 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkFloatLookupTablePropertySerializer_h_included
 #define mitkFloatLookupTablePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkProperties.h"
 #include <mitkLexicalCast.h>
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class FloatLookupTablePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(FloatLookupTablePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(FloatLookupTablePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       const FloatLookupTableProperty *prop = dynamic_cast<const FloatLookupTableProperty *>(m_Property.GetPointer());
       if (prop == nullptr)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
       FloatLookupTable lut = prop->GetValue();
       // if (lut.IsNull())
       //  return nullptr; // really?
       const FloatLookupTable::LookupTableType &map = lut.GetLookupTable();
 
-      auto element = new TiXmlElement("FloatLookupTableTable");
+      auto *element = doc.NewElement("FloatLookupTableTable");
       for (auto it = map.begin(); it != map.end(); ++it)
       {
-        auto tableEntry = new TiXmlElement("LUTValue");
+        auto *tableEntry = doc.NewElement("LUTValue");
         tableEntry->SetAttribute("id", it->first);
-        tableEntry->SetAttribute("value", boost::lexical_cast<std::string>(it->second));
-        element->LinkEndChild(tableEntry);
+        tableEntry->SetAttribute("value", boost::lexical_cast<std::string>(it->second).c_str());
+        element->InsertEndChild(tableEntry);
       }
       return element;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
       FloatLookupTable lut;
-      for (TiXmlElement *child = element->FirstChildElement("LUTValue"); child != nullptr;
+      for (auto *child = element->FirstChildElement("LUTValue"); child != nullptr;
            child = child->NextSiblingElement("LUTValue"))
       {
         int tempID;
-        if (child->QueryIntAttribute("id", &tempID) != TIXML_SUCCESS)
+        if (child->QueryIntAttribute("id", &tempID) != tinyxml2::XML_SUCCESS)
           return nullptr;
         FloatLookupTable::IdentifierType id = static_cast<FloatLookupTable::IdentifierType>(tempID);
-        std::string value_string;
-        if (child->QueryStringAttribute("value", &value_string) != TIXML_SUCCESS)
+        const char* value_string = child->Attribute("value");
+        if (nullptr == value_string)
           return nullptr;
         try
         {
           lut.SetTableValue(id, boost::lexical_cast<float>(value_string));
         }
         catch (boost::bad_lexical_cast &e)
         {
           MITK_ERROR << "Could not parse string as number: " << e.what();
           return nullptr;
         }
       }
       return FloatLookupTableProperty::New(lut).GetPointer();
     }
 
   protected:
     FloatLookupTablePropertySerializer() {}
     ~FloatLookupTablePropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(FloatLookupTablePropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkFloatPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkFloatPropertySerializer.cpp
index b1aab7b373..3adf5caa0b 100644
--- a/Modules/SceneSerializationBase/src/mitkFloatPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkFloatPropertySerializer.cpp
@@ -1,80 +1,82 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkFloatPropertySerializer_h_included
 #define mitkFloatPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 
 #include "mitkProperties.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class FloatPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(FloatPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(FloatPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const FloatProperty *prop = dynamic_cast<const FloatProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("float");
-        element->SetAttribute("value", boost::lexical_cast<std::string>(prop->GetValue()));
+        auto *element = doc.NewElement("float");
+        element->SetAttribute("value", boost::lexical_cast<std::string>(prop->GetValue()).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string f_string;
-      if (element->QueryStringAttribute("value", &f_string) == TIXML_SUCCESS)
+      const char* f_string = element->Attribute("value");
+      if (nullptr != f_string)
       {
         try
         {
           return FloatProperty::New(boost::lexical_cast<float>(f_string)).GetPointer();
         }
         catch (boost::bad_lexical_cast &e)
         {
           MITK_ERROR << "Could not parse string as number: " << e.what();
           return nullptr;
         }
       }
       else
       {
         return nullptr;
       }
     }
 
   protected:
     FloatPropertySerializer() {}
     ~FloatPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(FloatPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkGroupTagPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkGroupTagPropertySerializer.cpp
index bda674c3dc..b9bb5f222d 100644
--- a/Modules/SceneSerializationBase/src/mitkGroupTagPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkGroupTagPropertySerializer.cpp
@@ -1,56 +1,55 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkGroupTagPropertySerializer_h_included
 #define mitkGroupTagPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkGroupTagProperty.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class GroupTagPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(GroupTagPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(GroupTagPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (dynamic_cast<const GroupTagProperty *>(m_Property.GetPointer()) != nullptr)
       {
-        auto element = new TiXmlElement("GroupTag");
+        auto *element = doc.NewElement("GroupTag");
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *) override
     {
-      // if (!element)
-      //  return nullptr;
       return GroupTagProperty::New().GetPointer();
     }
 
   protected:
     GroupTagPropertySerializer() {}
     ~GroupTagPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(GroupTagPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkIntLookupTablePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkIntLookupTablePropertySerializer.cpp
index 3b7737b589..c2d2272ea9 100644
--- a/Modules/SceneSerializationBase/src/mitkIntLookupTablePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkIntLookupTablePropertySerializer.cpp
@@ -1,77 +1,78 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkIntLookupTablePropertySerializer_h_included
 #define mitkIntLookupTablePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class IntLookupTablePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(IntLookupTablePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(IntLookupTablePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       const IntLookupTableProperty *prop = dynamic_cast<const IntLookupTableProperty *>(m_Property.GetPointer());
       if (prop == nullptr)
         return nullptr;
       IntLookupTable lut = prop->GetValue();
       // if (lut.IsNull())
       //  return nullptr; // really?
       const IntLookupTable::LookupTableType &map = lut.GetLookupTable();
 
-      auto element = new TiXmlElement("IntLookupTableTable");
+      auto element = doc.NewElement("IntLookupTableTable");
       for (auto it = map.begin(); it != map.end(); ++it)
       {
-        auto tableEntry = new TiXmlElement("LUTValue");
+        auto tableEntry = doc.NewElement("LUTValue");
         tableEntry->SetAttribute("id", it->first);
         tableEntry->SetAttribute("value", it->second);
-        element->LinkEndChild(tableEntry);
+        element->InsertEndChild(tableEntry);
       }
       return element;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       IntLookupTable lut;
-      for (TiXmlElement *child = element->FirstChildElement("LUTValue"); child != nullptr;
+      for (auto *child = element->FirstChildElement("LUTValue"); child != nullptr;
            child = child->NextSiblingElement("LUTValue"))
       {
         int temp;
-        if (child->QueryIntAttribute("id", &temp) == TIXML_WRONG_TYPE)
+        if (child->QueryIntAttribute("id", &temp) != tinyxml2::XML_SUCCESS)
           return nullptr; // TODO: can we do a better error handling?
         IntLookupTable::IdentifierType id = static_cast<IntLookupTable::IdentifierType>(temp);
-        if (child->QueryIntAttribute("value", &temp) == TIXML_WRONG_TYPE)
+        if (child->QueryIntAttribute("value", &temp) != tinyxml2::XML_SUCCESS)
           return nullptr; // TODO: can we do a better error handling?
         IntLookupTable::ValueType val = static_cast<IntLookupTable::ValueType>(temp);
         lut.SetTableValue(id, val);
       }
       return IntLookupTableProperty::New(lut).GetPointer();
     }
 
   protected:
     IntLookupTablePropertySerializer() {}
     ~IntLookupTablePropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(IntLookupTablePropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkIntPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkIntPropertySerializer.cpp
index 5792766f4b..a106b42257 100644
--- a/Modules/SceneSerializationBase/src/mitkIntPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkIntPropertySerializer.cpp
@@ -1,66 +1,67 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkIntPropertySerializer_h_included
 #define mitkIntPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class IntPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(IntPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(IntPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       if (const IntProperty *prop = dynamic_cast<const IntProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("int");
+        auto *element = doc.NewElement("int");
         element->SetAttribute("value", prop->GetValue());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       int integer;
-      if (element->QueryIntAttribute("value", &integer) == TIXML_SUCCESS)
+      if (element->QueryIntAttribute("value", &integer) == tinyxml2::XML_SUCCESS)
       {
         return IntProperty::New(integer).GetPointer();
       }
       else
       {
         return nullptr;
       }
     }
 
   protected:
     IntPropertySerializer() {}
     ~IntPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(IntPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkLevelWindowPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkLevelWindowPropertySerializer.cpp
index 82d9274353..aef921409c 100644
--- a/Modules/SceneSerializationBase/src/mitkLevelWindowPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkLevelWindowPropertySerializer.cpp
@@ -1,135 +1,124 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkLevelWindowPropertySerializer_h_included
 #define mitkLevelWindowPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkLevelWindowProperty.h"
 #include <mitkLexicalCast.h>
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class LevelWindowPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(LevelWindowPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(LevelWindowPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       if (const LevelWindowProperty *prop = dynamic_cast<const LevelWindowProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("LevelWindow");
+        auto *element = doc.NewElement("LevelWindow");
 
         LevelWindow lw = prop->GetLevelWindow();
-        std::string boolString("false");
-        if (lw.IsFixed() == true)
-          boolString = "true";
-        element->SetAttribute("fixed", boolString.c_str());
-
-        std::string boolStringFltImage("false");
-        if (lw.IsFloatingValues() == true)
-          boolStringFltImage = "true";
-        element->SetAttribute("isFloatingImage", boolStringFltImage.c_str());
-
-        auto child = new TiXmlElement("CurrentSettings");
-        element->LinkEndChild(child);
-        child->SetAttribute("level", boost::lexical_cast<std::string>(lw.GetLevel()));
-        child->SetAttribute("window", boost::lexical_cast<std::string>(lw.GetWindow()));
-
-        child = new TiXmlElement("DefaultSettings");
-        element->LinkEndChild(child);
-        child->SetAttribute("level", boost::lexical_cast<std::string>(lw.GetDefaultLevel()));
-        child->SetAttribute("window", boost::lexical_cast<std::string>(lw.GetDefaultWindow()));
-
-        child = new TiXmlElement("CurrentRange");
-        element->LinkEndChild(child);
-        child->SetAttribute("min", boost::lexical_cast<std::string>(lw.GetRangeMin()));
-        child->SetAttribute("max", boost::lexical_cast<std::string>(lw.GetRangeMax()));
+        element->SetAttribute("fixed", lw.IsFixed());
+        element->SetAttribute("isFloatingImage", lw.IsFloatingValues());
+
+        auto *child = doc.NewElement("CurrentSettings");
+        element->InsertEndChild(child);
+        child->SetAttribute("level", boost::lexical_cast<std::string>(lw.GetLevel()).c_str());
+        child->SetAttribute("window", boost::lexical_cast<std::string>(lw.GetWindow()).c_str());
+
+        child = doc.NewElement("DefaultSettings");
+        element->InsertEndChild(child);
+        child->SetAttribute("level", boost::lexical_cast<std::string>(lw.GetDefaultLevel()).c_str());
+        child->SetAttribute("window", boost::lexical_cast<std::string>(lw.GetDefaultWindow()).c_str());
+
+        child = doc.NewElement("CurrentRange");
+        element->InsertEndChild(child);
+        child->SetAttribute("min", boost::lexical_cast<std::string>(lw.GetRangeMin()).c_str());
+        child->SetAttribute("max", boost::lexical_cast<std::string>(lw.GetRangeMax()).c_str());
 
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
       bool isFixed(false);
       if (element->Attribute("fixed"))
         isFixed = std::string(element->Attribute("fixed")) == "true";
       bool isFloatingImage(false);
       if (element->Attribute("isFloatingImage"))
         isFloatingImage = std::string(element->Attribute("isFloatingImage")) == "true";
 
-      std::string level_string;
-      std::string window_string;
-      TiXmlElement *child = element->FirstChildElement("CurrentSettings");
-      if (child->QueryStringAttribute("level", &level_string) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("window", &window_string) != TIXML_SUCCESS)
+      auto *child = element->FirstChildElement("CurrentSettings");
+      const char* level_string = child->Attribute("level");
+      const char* window_string = child->Attribute("window");
+      if (nullptr == level_string || nullptr == window_string)
         return nullptr;
 
-      std::string defaultLevel_string;
-      std::string defaultWindow_string;
       child = element->FirstChildElement("DefaultSettings");
-      if (child->QueryStringAttribute("level", &defaultLevel_string) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("window", &defaultWindow_string) != TIXML_SUCCESS)
+      const char* defaultLevel_string = child->Attribute("level");
+      const char* defaultWindow_string = child->Attribute("window");
+      if (nullptr == defaultLevel_string || nullptr == defaultWindow_string)
         return nullptr;
 
-      std::string minRange_string;
-      std::string maxRange_string;
       child = element->FirstChildElement("CurrentRange");
-      if (child->QueryStringAttribute("min", &minRange_string) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &maxRange_string) != TIXML_SUCCESS)
+      const char* minRange_string = child->Attribute("min");
+      const char* maxRange_string = child->Attribute("max");
+      if (nullptr == minRange_string || nullptr == maxRange_string)
         return nullptr;
 
       LevelWindow lw;
       try
       {
         lw.SetRangeMinMax(boost::lexical_cast<double>(minRange_string), boost::lexical_cast<double>(maxRange_string));
         lw.SetDefaultLevelWindow(boost::lexical_cast<double>(defaultLevel_string),
                                  boost::lexical_cast<double>(defaultWindow_string));
         lw.SetLevelWindow(boost::lexical_cast<double>(level_string), boost::lexical_cast<double>(window_string));
         lw.SetFixed(isFixed);
         lw.SetFloatingValues(isFloatingImage);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
       return LevelWindowProperty::New(lw).GetPointer();
     }
 
   protected:
     LevelWindowPropertySerializer() {}
     ~LevelWindowPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(LevelWindowPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkLookupTablePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkLookupTablePropertySerializer.cpp
index e22e63ff9a..3f82689963 100644
--- a/Modules/SceneSerializationBase/src/mitkLookupTablePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkLookupTablePropertySerializer.cpp
@@ -1,213 +1,227 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkLookupTablePropertySerializer.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
 #include <mitkLookupTableProperty.h>
 
-TiXmlElement *mitk::LookupTablePropertySerializer::Serialize()
+#include <array>
+
+#include <tinyxml2.h>
+
+tinyxml2::XMLElement *mitk::LookupTablePropertySerializer::Serialize(tinyxml2::XMLDocument& doc)
 {
   if (const auto *prop = dynamic_cast<const LookupTableProperty *>(m_Property.GetPointer()))
   {
     LocaleSwitch localeSwitch("C");
 
     LookupTable::Pointer mitkLut = const_cast<LookupTableProperty *>(prop)->GetLookupTable();
     if (mitkLut.IsNull())
       return nullptr; // really?
 
     vtkLookupTable *lut = mitkLut->GetVtkLookupTable();
     if (!lut)
       return nullptr;
 
-    auto element = new TiXmlElement("LookupTable");
+    auto *element = doc.NewElement("LookupTable");
 
     double *range;
     double *rgba;
 
-    element->SetAttribute("NumberOfColors", lut->GetNumberOfTableValues());
+    element->SetAttribute("NumberOfColors", static_cast<int>(lut->GetNumberOfTableValues()));
     element->SetAttribute("Scale", lut->GetScale());
     element->SetAttribute("Ramp", lut->GetRamp());
 
     range = lut->GetHueRange();
-    auto child = new TiXmlElement("HueRange");
-    element->LinkEndChild(child);
-    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]));
-    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]));
+    auto *child = doc.NewElement("HueRange");
+    element->InsertEndChild(child);
+    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]).c_str());
+    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]).c_str());
 
     range = lut->GetValueRange();
-    child = new TiXmlElement("ValueRange");
-    element->LinkEndChild(child);
-    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]));
-    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]));
+    child = doc.NewElement("ValueRange");
+    element->InsertEndChild(child);
+    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]).c_str());
+    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]).c_str());
 
     range = lut->GetSaturationRange();
-    child = new TiXmlElement("SaturationRange");
-    element->LinkEndChild(child);
-    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]));
-    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]));
+    child = doc.NewElement("SaturationRange");
+    element->InsertEndChild(child);
+    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]).c_str());
+    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]).c_str());
 
     range = lut->GetAlphaRange();
-    child = new TiXmlElement("AlphaRange");
-    element->LinkEndChild(child);
-    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]));
-    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]));
+    child = doc.NewElement("AlphaRange");
+    element->InsertEndChild(child);
+    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]).c_str());
+    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]).c_str());
 
     range = lut->GetTableRange();
-    child = new TiXmlElement("TableRange");
-    element->LinkEndChild(child);
-    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]));
-    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]));
+    child = doc.NewElement("TableRange");
+    element->InsertEndChild(child);
+    child->SetAttribute("min", boost::lexical_cast<std::string>(range[0]).c_str());
+    child->SetAttribute("max", boost::lexical_cast<std::string>(range[1]).c_str());
 
-    child = new TiXmlElement("Table");
-    element->LinkEndChild(child);
+    child = doc.NewElement("Table");
+    element->InsertEndChild(child);
     for (int index = 0; index < lut->GetNumberOfTableValues(); ++index)
     {
-      auto grandChild = new TiXmlElement("RgbaColor");
+      auto grandChild = doc.NewElement("RgbaColor");
       rgba = lut->GetTableValue(index);
-      grandChild->SetAttribute("R", boost::lexical_cast<std::string>(rgba[0]));
-      grandChild->SetAttribute("G", boost::lexical_cast<std::string>(rgba[1]));
-      grandChild->SetAttribute("B", boost::lexical_cast<std::string>(rgba[2]));
-      grandChild->SetAttribute("A", boost::lexical_cast<std::string>(rgba[3]));
-      child->LinkEndChild(grandChild);
+      grandChild->SetAttribute("R", boost::lexical_cast<std::string>(rgba[0]).c_str());
+      grandChild->SetAttribute("G", boost::lexical_cast<std::string>(rgba[1]).c_str());
+      grandChild->SetAttribute("B", boost::lexical_cast<std::string>(rgba[2]).c_str());
+      grandChild->SetAttribute("A", boost::lexical_cast<std::string>(rgba[3]).c_str());
+      child->InsertEndChild(grandChild);
     }
     return element;
   }
   else
     return nullptr;
 }
 
-mitk::BaseProperty::Pointer mitk::LookupTablePropertySerializer::Deserialize(TiXmlElement *element)
+mitk::BaseProperty::Pointer mitk::LookupTablePropertySerializer::Deserialize(const tinyxml2::XMLElement *element)
 {
   if (!element)
     return nullptr;
 
   LocaleSwitch localeSwitch("C");
 
   double range[2];
   double rgba[4];
 
-  std::string double_strings[4];
+  std::array<const char*, 4> double_strings;
 
   vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();
 
   int numberOfColors;
   int scale;
   int ramp; // hope the int values don't change betw. vtk versions...
-  if (element->QueryIntAttribute("NumberOfColors", &numberOfColors) == TIXML_SUCCESS)
+  if (element->QueryIntAttribute("NumberOfColors", &numberOfColors) == tinyxml2::XML_SUCCESS)
   {
     lut->SetNumberOfTableValues(numberOfColors);
   }
   else
     return nullptr;
-  if (element->QueryIntAttribute("Scale", &scale) == TIXML_SUCCESS)
+  if (element->QueryIntAttribute("Scale", &scale) == tinyxml2::XML_SUCCESS)
   {
     lut->SetScale(scale);
   }
   else
     return nullptr;
-  if (element->QueryIntAttribute("Ramp", &ramp) == TIXML_SUCCESS)
+  if (element->QueryIntAttribute("Ramp", &ramp) == tinyxml2::XML_SUCCESS)
   {
     lut->SetRamp(ramp);
   }
   else
     return nullptr;
 
   try
   {
-    TiXmlElement *child = element->FirstChildElement("HueRange");
+    auto *child = element->FirstChildElement("HueRange");
     if (child)
     {
-      if (child->QueryStringAttribute("min", &double_strings[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &double_strings[1]) != TIXML_SUCCESS)
+      double_strings[0] = child->Attribute("min");
+      double_strings[1] = child->Attribute("max");
+
+      if (nullptr == double_strings[0] || nullptr == double_strings[1])
         return nullptr;
+
       StringsToNumbers<double>(2, double_strings, range);
       lut->SetHueRange(range);
     }
 
     child = element->FirstChildElement("ValueRange");
     if (child)
     {
-      if (child->QueryStringAttribute("min", &double_strings[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &double_strings[1]) != TIXML_SUCCESS)
+      double_strings[0] = child->Attribute("min");
+      double_strings[1] = child->Attribute("max");
+
+      if (nullptr == double_strings[0] || nullptr == double_strings[1])
         return nullptr;
+
       StringsToNumbers<double>(2, double_strings, range);
       lut->SetValueRange(range);
     }
 
     child = element->FirstChildElement("SaturationRange");
     if (child)
     {
-      if (child->QueryStringAttribute("min", &double_strings[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &double_strings[1]) != TIXML_SUCCESS)
+      double_strings[0] = child->Attribute("min");
+      double_strings[1] = child->Attribute("max");
+
+      if (nullptr == double_strings[0] || nullptr == double_strings[1])
         return nullptr;
+
       StringsToNumbers<double>(2, double_strings, range);
       lut->SetSaturationRange(range);
     }
 
     child = element->FirstChildElement("AlphaRange");
     if (child)
     {
-      if (child->QueryStringAttribute("min", &double_strings[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &double_strings[1]) != TIXML_SUCCESS)
+      double_strings[0] = child->Attribute("min");
+      double_strings[1] = child->Attribute("max");
+
+      if (nullptr == double_strings[0] || nullptr == double_strings[1])
         return nullptr;
+
       StringsToNumbers<double>(2, double_strings, range);
       lut->SetAlphaRange(range);
     }
 
     child = element->FirstChildElement("TableRange");
     if (child)
     {
-      if (child->QueryStringAttribute("min", &double_strings[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (child->QueryStringAttribute("max", &double_strings[1]) != TIXML_SUCCESS)
+      double_strings[0] = child->Attribute("min");
+      double_strings[1] = child->Attribute("max");
+
+      if (nullptr == double_strings[0] || nullptr == double_strings[1])
         return nullptr;
+
       StringsToNumbers<double>(2, double_strings, range);
       lut->SetTableRange(range);
     }
 
     child = element->FirstChildElement("Table");
     if (child)
     {
       unsigned int index(0);
-      for (TiXmlElement *grandChild = child->FirstChildElement("RgbaColor"); grandChild;
+      for (auto *grandChild = child->FirstChildElement("RgbaColor"); grandChild;
            grandChild = grandChild->NextSiblingElement("RgbaColor"))
       {
-        if (grandChild->QueryStringAttribute("R", &double_strings[0]) != TIXML_SUCCESS)
-          return nullptr;
-        if (grandChild->QueryStringAttribute("G", &double_strings[1]) != TIXML_SUCCESS)
-          return nullptr;
-        if (grandChild->QueryStringAttribute("B", &double_strings[2]) != TIXML_SUCCESS)
-          return nullptr;
-        if (grandChild->QueryStringAttribute("A", &double_strings[3]) != TIXML_SUCCESS)
+        double_strings[0] = grandChild->Attribute("R");
+        double_strings[1] = grandChild->Attribute("G");
+        double_strings[2] = grandChild->Attribute("B");
+        double_strings[3] = grandChild->Attribute("A");
+
+        if (nullptr == double_strings[0] || nullptr == double_strings[1] || nullptr == double_strings[2] || nullptr == double_strings[3])
           return nullptr;
+
         StringsToNumbers<double>(4, double_strings, rgba);
         lut->SetTableValue(index, rgba);
         ++index;
       }
     }
   }
   catch (boost::bad_lexical_cast &e)
   {
     MITK_ERROR << "Could not parse string as number: " << e.what();
     return nullptr;
   }
 
   LookupTable::Pointer mitkLut = LookupTable::New();
   mitkLut->SetVtkLookupTable(lut);
 
   return LookupTableProperty::New(mitkLut).GetPointer();
 }
diff --git a/Modules/SceneSerializationBase/src/mitkPoint3dPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkPoint3dPropertySerializer.cpp
index e69d344d03..4d29ccf3cd 100644
--- a/Modules/SceneSerializationBase/src/mitkPoint3dPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkPoint3dPropertySerializer.cpp
@@ -1,83 +1,88 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkPoint3dPropertySerializer_h_included
 #define mitkPoint3dPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkProperties.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
 
+#include <array>
+
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class Point3dPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(Point3dPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(Point3dPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const Point3dProperty *prop = dynamic_cast<const Point3dProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("point");
+        auto *element = doc.NewElement("point");
         Point3D point = prop->GetValue();
-        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]));
-        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]));
-        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]));
+        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]).c_str());
+        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]).c_str());
+        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string v_str[3];
-      if (element->QueryStringAttribute("x", &v_str[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("y", &v_str[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("z", &v_str[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> v_str = {
+        element->Attribute("x"),
+        element->Attribute("y"),
+        element->Attribute("z")
+      };
+      if (nullptr == v_str[0] || nullptr == v_str[1] || nullptr == v_str[2])
         return nullptr;
       Point3D v;
       try
       {
         StringsToNumbers<double>(3, v_str, v);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
       return Point3dProperty::New(v).GetPointer();
     }
 
   protected:
     Point3dPropertySerializer() {}
     ~Point3dPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(Point3dPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkPoint3iPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkPoint3iPropertySerializer.cpp
index fc5fb86c6e..8294cf29f7 100644
--- a/Modules/SceneSerializationBase/src/mitkPoint3iPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkPoint3iPropertySerializer.cpp
@@ -1,64 +1,66 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkPoint3iPropertySerializer_h_included
 #define mitkPoint3iPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class Point3iPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(Point3iPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(Point3iPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const Point3iProperty *prop = dynamic_cast<const Point3iProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("point");
+        auto *element = doc.NewElement("point");
         Point3I point = prop->GetValue();
         element->SetAttribute("x", point[0]);
         element->SetAttribute("y", point[1]);
         element->SetAttribute("z", point[2]);
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       Point3I v;
-      if (element->QueryIntAttribute("x", &v[0]) != TIXML_SUCCESS)
+      if (element->QueryIntAttribute("x", &v[0]) != tinyxml2::XML_SUCCESS)
         return nullptr;
-      if (element->QueryIntAttribute("y", &v[1]) != TIXML_SUCCESS)
+      if (element->QueryIntAttribute("y", &v[1]) != tinyxml2::XML_SUCCESS)
         return nullptr;
-      if (element->QueryIntAttribute("z", &v[2]) != TIXML_SUCCESS)
+      if (element->QueryIntAttribute("z", &v[2]) != tinyxml2::XML_SUCCESS)
         return nullptr;
       return Point3iProperty::New(v).GetPointer();
     }
 
   protected:
     Point3iPropertySerializer() {}
     ~Point3iPropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(Point3iPropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkPoint4dPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkPoint4dPropertySerializer.cpp
index 68b59144ba..d35180121e 100644
--- a/Modules/SceneSerializationBase/src/mitkPoint4dPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkPoint4dPropertySerializer.cpp
@@ -1,86 +1,88 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkPoint4dPropertySerializer_h_included
 #define mitkPoint4dPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkProperties.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
+#include <array>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class Point4dPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(Point4dPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(Point4dPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const Point4dProperty *prop = dynamic_cast<const Point4dProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("point");
+        auto *element = doc.NewElement("point");
         Point4D point = prop->GetValue();
-        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]));
-        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]));
-        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]));
-        element->SetAttribute("t", boost::lexical_cast<std::string>(point[3]));
+        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]).c_str());
+        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]).c_str());
+        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]).c_str());
+        element->SetAttribute("t", boost::lexical_cast<std::string>(point[3]).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement* element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string v_str[4];
-      if (element->QueryStringAttribute("x", &v_str[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("y", &v_str[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("z", &v_str[2]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("t", &v_str[3]) != TIXML_SUCCESS)
+      std::array<const char*, 4> v_str = {
+        element->Attribute("x"),
+        element->Attribute("y"),
+        element->Attribute("z"),
+        element->Attribute("t")
+      };
+      if(nullptr == v_str[0] || nullptr == v_str[1] || nullptr == v_str[2] || nullptr == v_str[2])
         return nullptr;
       Point4D v;
       try
       {
         StringsToNumbers<double>(4, v_str, v);
       }
       catch (boost::bad_lexical_cast &e)
       {
         MITK_ERROR << "Could not parse string as number: " << e.what();
         return nullptr;
       }
       return Point4dProperty::New(v).GetPointer();
     }
 
   protected:
     Point4dPropertySerializer() {}
     ~Point4dPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(Point4dPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkPropertyListSerializer.cpp b/Modules/SceneSerializationBase/src/mitkPropertyListSerializer.cpp
index e384cee2ed..171c406681 100644
--- a/Modules/SceneSerializationBase/src/mitkPropertyListSerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkPropertyListSerializer.cpp
@@ -1,171 +1,168 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkPropertyListSerializer.h"
 #include "mitkBasePropertySerializer.h"
-
-#include <tinyxml.h>
-
 #include "mitkStandardFileLocations.h"
 #include <itksys/SystemTools.hxx>
+#include <tinyxml2.h>
 
 mitk::PropertyListSerializer::PropertyListSerializer() : m_FilenameHint("unnamed"), m_WorkingDirectory("")
 {
 }
 
 mitk::PropertyListSerializer::~PropertyListSerializer()
 {
 }
 
 std::string mitk::PropertyListSerializer::Serialize()
 {
   m_FailedProperties = PropertyList::New();
 
   if (m_PropertyList.IsNull() || m_PropertyList->IsEmpty())
   {
     MITK_ERROR << "Not serializing nullptr or empty PropertyList";
     return "";
   }
 
   // tmpname
   static unsigned long count = 1;
   unsigned long n = count++;
   std::ostringstream name;
   for (int i = 0; i < 6; ++i)
   {
     name << char('a' + (n % 26));
     n /= 26;
   }
   std::string filename;
   filename.append(name.str());
 
   std::string fullname(m_WorkingDirectory);
   fullname += "/";
   fullname += filename;
   fullname = itksys::SystemTools::ConvertToOutputPath(fullname.c_str());
 
   // Trim quotes
   std::string::size_type length = fullname.length();
 
   if (length >= 2 && fullname[0] == '"' && fullname[length - 1] == '"')
     fullname = fullname.substr(1, length - 2);
 
-  TiXmlDocument document;
-  auto decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc....
-  document.LinkEndChild(decl);
+  tinyxml2::XMLDocument document;
+  document.InsertEndChild(document.NewDeclaration());
 
-  auto version = new TiXmlElement("Version");
+  auto *version = document.NewElement("Version");
   version->SetAttribute("Writer", __FILE__);
   version->SetAttribute("Revision", "$Revision: 17055 $");
   version->SetAttribute("FileVersion", 1);
-  document.LinkEndChild(version);
+  document.InsertEndChild(version);
 
   // add XML contents
   const PropertyList::PropertyMap *propmap = m_PropertyList->GetMap();
   for (auto iter = propmap->begin(); iter != propmap->end(); ++iter)
   {
     std::string key = iter->first;
     const BaseProperty *property = iter->second;
-    TiXmlElement *element = SerializeOneProperty(key, property);
+    auto *element = SerializeOneProperty(document, key, property);
     if (element)
     {
-      document.LinkEndChild(element);
+      document.InsertEndChild(element);
       // TODO test serializer for error
     }
     else
     {
       m_FailedProperties->ReplaceProperty(key, const_cast<BaseProperty *>(property));
     }
   }
 
   // save XML file
-  if (!document.SaveFile(fullname))
+  if (tinyxml2::XML_SUCCESS != document.SaveFile(fullname.c_str()))
   {
-    MITK_ERROR << "Could not write PropertyList to " << fullname << "\nTinyXML reports '" << document.ErrorDesc()
+    MITK_ERROR << "Could not write PropertyList to " << fullname << "\nTinyXML reports '" << document.ErrorStr()
                << "'";
     return "";
   }
 
   return filename;
 }
 
-TiXmlElement *mitk::PropertyListSerializer::SerializeOneProperty(const std::string &key, const BaseProperty *property)
+tinyxml2::XMLElement *mitk::PropertyListSerializer::SerializeOneProperty(tinyxml2::XMLDocument &doc, const std::string &key, const BaseProperty *property)
 {
-  auto keyelement = new TiXmlElement("property");
-  keyelement->SetAttribute("key", key);
+  auto *keyelement = doc.NewElement("property");
+  keyelement->SetAttribute("key", key.c_str());
   keyelement->SetAttribute("type", property->GetNameOfClass());
 
   // construct name of serializer class
   std::string serializername(property->GetNameOfClass());
   serializername += "Serializer";
 
   std::list<itk::LightObject::Pointer> allSerializers =
     itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
   if (allSerializers.size() < 1)
   {
     MITK_ERROR << "No serializer found for " << property->GetNameOfClass() << ". Skipping object";
   }
   if (allSerializers.size() > 1)
   {
     MITK_WARN << "Multiple serializers found for " << property->GetNameOfClass() << "Using arbitrarily the first one.";
   }
 
   for (auto iter = allSerializers.begin(); iter != allSerializers.end(); ++iter)
   {
     if (auto *serializer = dynamic_cast<BasePropertySerializer *>(iter->GetPointer()))
     {
       serializer->SetProperty(property);
       try
       {
-        TiXmlElement *valueelement = serializer->Serialize();
+        auto *valueelement = serializer->Serialize(doc);
         if (valueelement)
         {
-          keyelement->LinkEndChild(valueelement);
+          keyelement->InsertEndChild(valueelement);
         }
       }
       catch (std::exception &e)
       {
         MITK_ERROR << "Serializer " << serializer->GetNameOfClass() << " failed: " << e.what();
         // \TODO: log only if all potential serializers fail?
       }
       break;
     }
     else
     {
       MITK_ERROR << "Found a serializer called '" << (*iter)->GetNameOfClass()
                  << "' that does not implement the BasePropertySerializer interface.";
       continue;
     }
   }
 
   if (keyelement->NoChildren())
   {
     m_FailedProperties->ReplaceProperty(key, const_cast<BaseProperty *>(property));
     return nullptr;
   }
   else
   {
     return keyelement;
   }
 }
 
 mitk::PropertyList *mitk::PropertyListSerializer::GetFailedProperties()
 {
   if (m_FailedProperties.IsNotNull() && !m_FailedProperties->IsEmpty())
   {
     return m_FailedProperties;
   }
   else
   {
     return nullptr;
   }
 }
diff --git a/Modules/SceneSerializationBase/src/mitkStringLookupTablePropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkStringLookupTablePropertySerializer.cpp
index d8b293b170..c2b8adb17d 100644
--- a/Modules/SceneSerializationBase/src/mitkStringLookupTablePropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkStringLookupTablePropertySerializer.cpp
@@ -1,78 +1,79 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkStringLookupTablePropertySerializer_h_included
 #define mitkStringLookupTablePropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class StringLookupTablePropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(StringLookupTablePropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(StringLookupTablePropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       const StringLookupTableProperty *prop = dynamic_cast<const StringLookupTableProperty *>(m_Property.GetPointer());
       if (prop == nullptr)
         return nullptr;
       StringLookupTable lut = prop->GetValue();
       // if (lut.IsNull())
       //  return nullptr; // really?
       const StringLookupTable::LookupTableType &map = lut.GetLookupTable();
 
-      auto element = new TiXmlElement("StringLookupTable");
+      auto *element = doc.NewElement("StringLookupTable");
       for (auto it = map.begin(); it != map.end(); ++it)
       {
-        auto tableEntry = new TiXmlElement("LUTValue");
+        auto *tableEntry = doc.NewElement("LUTValue");
         tableEntry->SetAttribute("id", it->first);
-        tableEntry->SetAttribute("value", it->second);
-        element->LinkEndChild(tableEntry);
+        tableEntry->SetAttribute("value", it->second.c_str());
+        element->InsertEndChild(tableEntry);
       }
       return element;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       StringLookupTable lut;
-      for (TiXmlElement *child = element->FirstChildElement("LUTValue"); child != nullptr;
+      for (auto *child = element->FirstChildElement("LUTValue"); child != nullptr;
            child = child->NextSiblingElement("LUTValue"))
       {
         int temp;
-        if (child->QueryIntAttribute("id", &temp) == TIXML_WRONG_TYPE)
+        if (child->QueryIntAttribute("id", &temp) != tinyxml2::XML_SUCCESS)
           return nullptr; // TODO: can we do a better error handling?
         StringLookupTable::IdentifierType id = static_cast<StringLookupTable::IdentifierType>(temp);
 
         if (child->Attribute("value") == nullptr)
           return nullptr; // TODO: can we do a better error handling?
         StringLookupTable::ValueType val = child->Attribute("value");
         lut.SetTableValue(id, val);
       }
       return StringLookupTableProperty::New(lut).GetPointer();
     }
 
   protected:
     StringLookupTablePropertySerializer() {}
     ~StringLookupTablePropertySerializer() override {}
   };
 } // namespace
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(StringLookupTablePropertySerializer);
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkStringPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkStringPropertySerializer.cpp
index 9144709397..28e053b8cc 100644
--- a/Modules/SceneSerializationBase/src/mitkStringPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkStringPropertySerializer.cpp
@@ -1,58 +1,59 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkStringPropertySerializer_h_included
 #define mitkStringPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkStringProperty.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class StringPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(StringPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(StringPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override
     {
       if (const StringProperty *prop = dynamic_cast<const StringProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("string");
+        auto *element = doc.NewElement("string");
         element->SetAttribute("value", prop->GetValue());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
       const char *s(element->Attribute("value"));
       return StringProperty::New(std::string(s ? s : "")).GetPointer();
     }
 
   protected:
     StringPropertySerializer() {}
     ~StringPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(StringPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkTemporoSpatialStringPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkTemporoSpatialStringPropertySerializer.cpp
index 2d25efcb22..25e2ae1693 100644
--- a/Modules/SceneSerializationBase/src/mitkTemporoSpatialStringPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkTemporoSpatialStringPropertySerializer.cpp
@@ -1,62 +1,63 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkTemporoSpatialStringPropertySerializer_h_included
 #define mitkTemporoSpatialStringPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkTemporoSpatialStringProperty.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class TemporoSpatialStringPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(TemporoSpatialStringPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(TemporoSpatialStringPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const TemporoSpatialStringProperty *prop =
             dynamic_cast<const TemporoSpatialStringProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("temporo_spatial_string");
+        auto *element = doc.NewElement("temporo_spatial_string");
         std::string content = PropertyPersistenceSerialization::serializeTemporoSpatialStringPropertyToJSON(prop);
-        TiXmlText text(content.c_str());
+        auto* text = doc.NewText(content.c_str());
         element->InsertEndChild(text);
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
       const char *s(element->GetText());
       std::string content = s ? s : "";
       return PropertyPersistenceDeserialization::deserializeJSONToTemporoSpatialStringProperty(content);
     }
 
   protected:
     TemporoSpatialStringPropertySerializer() {}
     ~TemporoSpatialStringPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(TemporoSpatialStringPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkTransferFunctionPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkTransferFunctionPropertySerializer.cpp
index 8b63f9e01a..5b3d9c65ec 100644
--- a/Modules/SceneSerializationBase/src/mitkTransferFunctionPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkTransferFunctionPropertySerializer.cpp
@@ -1,260 +1,249 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkTransferFunctionPropertySerializer.h"
 #include <mitkLexicalCast.h>
 #include <mitkLocaleSwitch.h>
+#include <tinyxml2.h>
 
 namespace mitk
 {
   mitk::TransferFunctionPropertySerializer::TransferFunctionPropertySerializer() {}
   mitk::TransferFunctionPropertySerializer::~TransferFunctionPropertySerializer() {}
-  TiXmlElement *mitk::TransferFunctionPropertySerializer::Serialize()
+  tinyxml2::XMLElement *mitk::TransferFunctionPropertySerializer::Serialize(tinyxml2::XMLDocument &doc)
   {
     if (const auto *prop =
           dynamic_cast<const TransferFunctionProperty *>(mitk::BasePropertySerializer::m_Property.GetPointer()))
     {
       LocaleSwitch localeSwitch("C");
 
       TransferFunction *transferfunction = prop->GetValue();
       if (!transferfunction)
         return nullptr;
 
-      auto element = new TiXmlElement("TransferFunction");
+      auto *element = doc.NewElement("TransferFunction");
 
       // serialize scalar opacity function
-      auto scalarOpacityPointlist = new TiXmlElement("ScalarOpacity");
+      auto *scalarOpacityPointlist = doc.NewElement("ScalarOpacity");
 
       TransferFunction::ControlPoints scalarOpacityPoints = transferfunction->GetScalarOpacityPoints();
       for (auto iter = scalarOpacityPoints.begin(); iter != scalarOpacityPoints.end(); ++iter)
       {
-        auto pointel = new TiXmlElement("point");
-        pointel->SetAttribute("x", boost::lexical_cast<std::string>(iter->first));
-        pointel->SetAttribute("y", boost::lexical_cast<std::string>(iter->second));
-        scalarOpacityPointlist->LinkEndChild(pointel);
+        auto *pointel = doc.NewElement("point");
+        pointel->SetAttribute("x", boost::lexical_cast<std::string>(iter->first).c_str());
+        pointel->SetAttribute("y", boost::lexical_cast<std::string>(iter->second).c_str());
+        scalarOpacityPointlist->InsertEndChild(pointel);
       }
-      element->LinkEndChild(scalarOpacityPointlist);
+      element->InsertEndChild(scalarOpacityPointlist);
       // serialize gradient opacity function
-      auto gradientOpacityPointlist = new TiXmlElement("GradientOpacity");
+      auto *gradientOpacityPointlist = doc.NewElement("GradientOpacity");
       TransferFunction::ControlPoints gradientOpacityPoints = transferfunction->GetGradientOpacityPoints();
       for (auto iter = gradientOpacityPoints.begin(); iter != gradientOpacityPoints.end(); ++iter)
       {
-        auto pointel = new TiXmlElement("point");
-        pointel->SetAttribute("x", boost::lexical_cast<std::string>(iter->first));
-        pointel->SetAttribute("y", boost::lexical_cast<std::string>(iter->second));
-        gradientOpacityPointlist->LinkEndChild(pointel);
+        auto *pointel = doc.NewElement("point");
+        pointel->SetAttribute("x", boost::lexical_cast<std::string>(iter->first).c_str());
+        pointel->SetAttribute("y", boost::lexical_cast<std::string>(iter->second).c_str());
+        gradientOpacityPointlist->InsertEndChild(pointel);
       }
-      element->LinkEndChild(gradientOpacityPointlist);
+      element->InsertEndChild(gradientOpacityPointlist);
 
       // serialize color function
       vtkColorTransferFunction *ctf = transferfunction->GetColorTransferFunction();
       if (ctf == nullptr)
         return nullptr;
-      auto pointlist = new TiXmlElement("Color");
+      auto *pointlist = doc.NewElement("Color");
       for (int i = 0; i < ctf->GetSize(); i++)
       {
         double myVal[6];
         ctf->GetNodeValue(i, myVal);
-        auto pointel = new TiXmlElement("point");
-        pointel->SetAttribute("x", boost::lexical_cast<std::string>(myVal[0]));
-        pointel->SetAttribute("r", boost::lexical_cast<std::string>(myVal[1]));
-        pointel->SetAttribute("g", boost::lexical_cast<std::string>(myVal[2]));
-        pointel->SetAttribute("b", boost::lexical_cast<std::string>(myVal[3]));
-        pointel->SetAttribute("midpoint", boost::lexical_cast<std::string>(myVal[4]));
-        pointel->SetAttribute("sharpness", boost::lexical_cast<std::string>(myVal[5]));
-        pointlist->LinkEndChild(pointel);
+        auto *pointel = doc.NewElement("point");
+        pointel->SetAttribute("x", boost::lexical_cast<std::string>(myVal[0]).c_str());
+        pointel->SetAttribute("r", boost::lexical_cast<std::string>(myVal[1]).c_str());
+        pointel->SetAttribute("g", boost::lexical_cast<std::string>(myVal[2]).c_str());
+        pointel->SetAttribute("b", boost::lexical_cast<std::string>(myVal[3]).c_str());
+        pointel->SetAttribute("midpoint", boost::lexical_cast<std::string>(myVal[4]).c_str());
+        pointel->SetAttribute("sharpness", boost::lexical_cast<std::string>(myVal[5]).c_str());
+        pointlist->InsertEndChild(pointel);
       }
-      element->LinkEndChild(pointlist);
+      element->InsertEndChild(pointlist);
       return element;
     }
     else
       return nullptr;
   }
 
   bool mitk::TransferFunctionPropertySerializer::SerializeTransferFunction(const char *filename,
                                                                            TransferFunction::Pointer tf)
   {
     TransferFunctionPropertySerializer::Pointer tfps = TransferFunctionPropertySerializer::New();
     tfps->SetProperty(TransferFunctionProperty::New(tf));
-    TiXmlElement *s = tfps->Serialize();
+
+    tinyxml2::XMLDocument doc;
+    auto *s = tfps->Serialize(doc);
 
     if (!s)
     {
       MITK_ERROR << "cant serialize transfer function";
 
       return false;
     }
 
-    TiXmlDocument document;
-    auto decl = new TiXmlDeclaration(
-      "1.0",
-      "UTF-8",
-      ""); // TODO what to write here? encoding? standalone would mean that we provide a DTD somewhere...
-    document.LinkEndChild(decl);
+    tinyxml2::XMLDocument doc2;
+    doc2.InsertEndChild(doc2.NewDeclaration());
 
-    auto version = new TiXmlElement("Version");
+    auto *version = doc2.NewElement("Version");
     version->SetAttribute("TransferfunctionVersion", 1);
 
-    document.LinkEndChild(version);
-    document.LinkEndChild(s);
+    doc2.InsertEndChild(version);
+    doc2.InsertEndChild(s->DeepClone(&doc2));
 
-    if (!document.SaveFile(filename))
+    if (tinyxml2::XML_SUCCESS != doc2.SaveFile(filename))
     {
-      MITK_ERROR << "Could not write scene to " << filename << "\nTinyXML reports '" << document.ErrorDesc() << "'";
+      MITK_ERROR << "Could not write scene to " << filename << "\nTinyXML reports '" << doc2.ErrorStr() << "'";
       return false;
     }
     return true;
   }
 
-  BaseProperty::Pointer mitk::TransferFunctionPropertySerializer::Deserialize(TiXmlElement *element)
+  BaseProperty::Pointer mitk::TransferFunctionPropertySerializer::Deserialize(const tinyxml2::XMLElement *element)
   {
     if (!element)
       return nullptr;
 
     mitk::LocaleSwitch localeSwitch("C");
 
     TransferFunction::Pointer tf = TransferFunction::New();
 
     // deserialize scalar opacity function
-    TiXmlElement *scalarOpacityPointlist = element->FirstChildElement("ScalarOpacity");
+    auto *scalarOpacityPointlist = element->FirstChildElement("ScalarOpacity");
     if (scalarOpacityPointlist == nullptr)
     {
       return nullptr;
     }
 
     tf->ClearScalarOpacityPoints();
 
     try
     {
-      for (TiXmlElement *pointElement = scalarOpacityPointlist->FirstChildElement("point"); pointElement != nullptr;
+      for (auto *pointElement = scalarOpacityPointlist->FirstChildElement("point"); pointElement != nullptr;
            pointElement = pointElement->NextSiblingElement("point"))
       {
-        std::string x;
-        std::string y;
-        if (pointElement->QueryStringAttribute("x", &x) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("y", &y) != TIXML_SUCCESS)
+        const char* x = pointElement->Attribute("x");
+        const char* y = pointElement->Attribute("y");
+        if (nullptr == x || nullptr == y)
           return nullptr;
         tf->AddScalarOpacityPoint(boost::lexical_cast<double>(x), boost::lexical_cast<double>(y));
       }
 
-      TiXmlElement *gradientOpacityPointlist = element->FirstChildElement("GradientOpacity");
+      auto *gradientOpacityPointlist = element->FirstChildElement("GradientOpacity");
       if (gradientOpacityPointlist == nullptr)
       {
         return nullptr;
       }
 
       tf->ClearGradientOpacityPoints();
 
-      for (TiXmlElement *pointElement = gradientOpacityPointlist->FirstChildElement("point"); pointElement != nullptr;
+      for (auto *pointElement = gradientOpacityPointlist->FirstChildElement("point"); pointElement != nullptr;
            pointElement = pointElement->NextSiblingElement("point"))
       {
-        std::string x;
-        std::string y;
-        if (pointElement->QueryStringAttribute("x", &x) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("y", &y) != TIXML_SUCCESS)
+        const char* x = pointElement->Attribute("x");
+        const char* y = pointElement->Attribute("y");
+        if (nullptr == x || nullptr == y)
           return nullptr;
         tf->AddGradientOpacityPoint(boost::lexical_cast<double>(x), boost::lexical_cast<double>(y));
       }
 
-      TiXmlElement *rgbPointlist = element->FirstChildElement("Color");
+      auto *rgbPointlist = element->FirstChildElement("Color");
       if (rgbPointlist == nullptr)
       {
         return nullptr;
       }
       vtkColorTransferFunction *ctf = tf->GetColorTransferFunction();
       if (ctf == nullptr)
       {
         return nullptr;
       }
 
       ctf->RemoveAllPoints();
 
-      for (TiXmlElement *pointElement = rgbPointlist->FirstChildElement("point"); pointElement != nullptr;
+      for (auto *pointElement = rgbPointlist->FirstChildElement("point"); pointElement != nullptr;
            pointElement = pointElement->NextSiblingElement("point"))
       {
-        std::string x;
-        std::string r, g, b, midpoint, sharpness;
-        if (pointElement->QueryStringAttribute("x", &x) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("r", &r) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("g", &g) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("b", &b) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("midpoint", &midpoint) != TIXML_SUCCESS)
-          return nullptr;
-        if (pointElement->QueryStringAttribute("sharpness", &sharpness) != TIXML_SUCCESS)
+        const char* x = pointElement->Attribute("x");
+        const char* r = pointElement->Attribute("r");
+        const char* g = pointElement->Attribute("g");
+        const char* b = pointElement->Attribute("b");
+        const char* midpoint = pointElement->Attribute("midpoint");
+        const char* sharpness = pointElement->Attribute("sharpness");
+        if (nullptr == x || nullptr == r || nullptr == g || nullptr == b || nullptr == midpoint || nullptr == sharpness)
           return nullptr;
         ctf->AddRGBPoint(boost::lexical_cast<double>(x),
                          boost::lexical_cast<double>(r),
                          boost::lexical_cast<double>(g),
                          boost::lexical_cast<double>(b),
                          boost::lexical_cast<double>(midpoint),
                          boost::lexical_cast<double>(sharpness));
       }
     }
     catch (boost::bad_lexical_cast &e)
     {
       MITK_ERROR << "Could not parse string as number: " << e.what();
 
       return nullptr;
     }
 
     return TransferFunctionProperty::New(tf).GetPointer();
   }
 
   mitk::TransferFunction::Pointer mitk::TransferFunctionPropertySerializer::DeserializeTransferFunction(
     const char *filePath)
   {
-    TiXmlDocument document(filePath);
+    tinyxml2::XMLDocument document;
 
-    if (!document.LoadFile())
+    if (tinyxml2::XML_SUCCESS != document.LoadFile(filePath))
     {
-      MITK_ERROR << "Could not open/read/parse " << filePath << "\nTinyXML reports: " << document.ErrorDesc()
+      MITK_ERROR << "Could not open/read/parse " << filePath << "\nTinyXML reports: " << document.ErrorStr()
                  << std::endl;
       return nullptr;
     }
 
     // find version node --> note version in some variable
     int fileVersion = 1;
-    TiXmlElement *versionObject = document.FirstChildElement("Version");
+    auto *versionObject = document.FirstChildElement("Version");
     if (versionObject)
     {
-      if (versionObject->QueryIntAttribute("TransferfunctionVersion", &fileVersion) != TIXML_SUCCESS)
+      if (versionObject->QueryIntAttribute("TransferfunctionVersion", &fileVersion) != tinyxml2::XML_SUCCESS)
       {
         MITK_WARN << "Transferfunction file " << filePath
                   << " does not contain version information! Trying version 1 format.";
       }
     }
 
-    TiXmlElement *input = document.FirstChildElement("TransferFunction");
+    auto *input = document.FirstChildElement("TransferFunction");
 
     TransferFunctionPropertySerializer::Pointer tfpd = TransferFunctionPropertySerializer::New();
     BaseProperty::Pointer bp = tfpd->Deserialize(input);
     TransferFunctionProperty::Pointer tfp = dynamic_cast<TransferFunctionProperty *>(bp.GetPointer());
 
     if (tfp.IsNotNull())
     {
       TransferFunction::Pointer tf = tfp->GetValue();
       return tf;
     }
     MITK_WARN << "Can't deserialize transfer function";
     return nullptr;
   }
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(TransferFunctionPropertySerializer);
diff --git a/Modules/SceneSerializationBase/src/mitkUIntPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkUIntPropertySerializer.cpp
index d6695bf813..3efaca23c7 100644
--- a/Modules/SceneSerializationBase/src/mitkUIntPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkUIntPropertySerializer.cpp
@@ -1,66 +1,67 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkUIntPropertySerializer_h_included
 #define mitkUIntPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class UIntPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(UIntPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(UIntPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const UIntProperty *prop = dynamic_cast<const UIntProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("unsigned");
+        auto *element = doc.NewElement("unsigned");
         element->SetAttribute("value", static_cast<unsigned int>(prop->GetValue()));
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       unsigned int integer;
-      if (element->QueryUnsignedAttribute("value", &integer) == TIXML_SUCCESS)
+      if (element->QueryUnsignedAttribute("value", &integer) == tinyxml2::XML_SUCCESS)
       {
         return UIntProperty::New(integer).GetPointer();
       }
       else
       {
         return nullptr;
       }
     }
 
   protected:
     UIntPropertySerializer() {}
     ~UIntPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(UIntPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkUShortPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkUShortPropertySerializer.cpp
index 5d58407616..8aa03d622e 100644
--- a/Modules/SceneSerializationBase/src/mitkUShortPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkUShortPropertySerializer.cpp
@@ -1,66 +1,67 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkUShortPropertySerializer_h_included
 #define mitkUShortPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
-
 #include "mitkProperties.h"
+#include <tinyxml2.h>
 
 namespace mitk
 {
   class UShortPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(UShortPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(UShortPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const UShortProperty *prop = dynamic_cast<const UShortProperty *>(m_Property.GetPointer()))
       {
-        auto element = new TiXmlElement("unsigned");
+        auto *element = doc.NewElement("unsigned");
         element->SetAttribute("value", static_cast<unsigned short>(prop->GetValue()));
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       unsigned int value;
-      if (element->QueryUnsignedAttribute("value", &value) == TIXML_SUCCESS)
+      if (element->QueryUnsignedAttribute("value", &value) == tinyxml2::XML_SUCCESS)
       {
         return UShortProperty::New(static_cast<unsigned short>(value)).GetPointer();
       }
       else
       {
         return nullptr;
       }
     }
 
   protected:
     UShortPropertySerializer() {}
     ~UShortPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(UShortPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/src/mitkVector3DPropertySerializer.cpp b/Modules/SceneSerializationBase/src/mitkVector3DPropertySerializer.cpp
index 8861398cd3..e961a00a96 100644
--- a/Modules/SceneSerializationBase/src/mitkVector3DPropertySerializer.cpp
+++ b/Modules/SceneSerializationBase/src/mitkVector3DPropertySerializer.cpp
@@ -1,84 +1,89 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkVector3DPropertySerializer_h_included
 #define mitkVector3DPropertySerializer_h_included
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkProperties.h"
 #include "mitkStringsToNumbers.h"
 #include <mitkLocaleSwitch.h>
 
+#include <array>
+
+#include <tinyxml2.h>
+
 namespace mitk
 {
   class Vector3DPropertySerializer : public BasePropertySerializer
   {
   public:
-    mitkClassMacro(Vector3DPropertySerializer, BasePropertySerializer);
-    itkFactorylessNewMacro(Self) itkCloneMacro(Self)
+    mitkClassMacro(Vector3DPropertySerializer, BasePropertySerializer)
+    itkFactorylessNewMacro(Self)
+    itkCloneMacro(Self)
 
-      TiXmlElement *Serialize() override
+    tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override
     {
       if (const Vector3DProperty *prop = dynamic_cast<const Vector3DProperty *>(m_Property.GetPointer()))
       {
         LocaleSwitch localeSwitch("C");
 
-        auto element = new TiXmlElement("vector");
+        auto *element = doc.NewElement("vector");
         Vector3D point = prop->GetValue();
-        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]));
-        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]));
-        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]));
+        element->SetAttribute("x", boost::lexical_cast<std::string>(point[0]).c_str());
+        element->SetAttribute("y", boost::lexical_cast<std::string>(point[1]).c_str());
+        element->SetAttribute("z", boost::lexical_cast<std::string>(point[2]).c_str());
         return element;
       }
       else
         return nullptr;
     }
 
-    BaseProperty::Pointer Deserialize(TiXmlElement *element) override
+    BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override
     {
       if (!element)
         return nullptr;
 
       LocaleSwitch localeSwitch("C");
 
-      std::string v_str[3];
-      if (element->QueryStringAttribute("x", &v_str[0]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("y", &v_str[1]) != TIXML_SUCCESS)
-        return nullptr;
-      if (element->QueryStringAttribute("z", &v_str[2]) != TIXML_SUCCESS)
+      std::array<const char*, 3> v_str = {
+        element->Attribute("x"),
+        element->Attribute("y"),
+        element->Attribute("z")
+      };
+      if (nullptr == v_str[0] || nullptr == v_str[1] || nullptr == v_str[2])
         return nullptr;
       Vector3D v;
       try
       {
         StringsToNumbers<double>(3, v_str, v);
       }
       catch (boost::bad_lexical_cast &e)
       {
-        MITK_ERROR << "Could not parse string '" << v_str << "'as number: " << e.what();
+        MITK_ERROR << "Could not parse strings as numbers: " << e.what();
         return nullptr;
       }
 
       return Vector3DProperty::New(v).GetPointer();
     }
 
   protected:
     Vector3DPropertySerializer() {}
     ~Vector3DPropertySerializer() override {}
   };
 
 } // namespace
 
 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
 MITK_REGISTER_SERIALIZER(Vector3DPropertySerializer);
 
 #endif
diff --git a/Modules/SceneSerializationBase/test/mitkPropertySerializationTest.cpp b/Modules/SceneSerializationBase/test/mitkPropertySerializationTest.cpp
index c6cfe3b656..df7caa32f5 100644
--- a/Modules/SceneSerializationBase/test/mitkPropertySerializationTest.cpp
+++ b/Modules/SceneSerializationBase/test/mitkPropertySerializationTest.cpp
@@ -1,199 +1,202 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkTestingMacros.h"
 
 #include "mitkCoreObjectFactory.h"
 
 #include "mitkBaseProperty.h"
 #include "mitkProperties.h"
 #include <mitkAnnotationProperty.h>
 #include <mitkClippingProperty.h>
 #include <mitkColorProperty.h>
 #include <mitkEnumerationProperty.h>
 #include <mitkModalityProperty.h>
 #include <mitkGroupTagProperty.h>
 #include <mitkLevelWindowProperty.h>
 #include <mitkLookupTableProperty.h>
 #include <mitkPlaneOrientationProperty.h>
 #include <mitkStringProperty.h>
 #include <mitkTransferFunctionProperty.h>
 #include <mitkVtkInterpolationProperty.h>
 #include <mitkVtkRepresentationProperty.h>
 #include <mitkVtkResliceInterpolationProperty.h>
 #include <mitkVtkScalarModeProperty.h>
 #include <mitkVtkVolumeRenderingProperty.h>
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkPropertyList.h"
 #include "mitkPropertyListSerializer.h"
 
 #include <mitkImage.h>
 #include <mitkPointSet.h>
 #include <mitkSurface.h>
 #include <mitkVtkWidgetRendering.h>
 
+#include <tinyxml2.h>
+
 void TestAllProperties(const mitk::PropertyList *propList);
 
 /**Documentation
 * \brief Test for all PropertySerializer classes.
 *
 */
 int mitkPropertySerializationTest(int /* argc */, char * /*argv*/ [])
 {
   MITK_TEST_BEGIN("PropertySerializationTest");
 
   mitk::PropertyListSerializer::Pointer serializer =
     mitk::PropertyListSerializer::New(); // make sure something from the lib is actually used (registration of
                                          // serializers)
 
   /* build list of properties that will be serialized and deserialized */
   mitk::PropertyList::Pointer propList = mitk::PropertyList::New();
   propList->SetProperty("booltrue", mitk::BoolProperty::New(true));
   propList->SetProperty("boolfalse", mitk::BoolProperty::New(false));
   propList->SetProperty("int", mitk::IntProperty::New(-32));
   propList->SetProperty("float", mitk::FloatProperty::New(-31.337));
   propList->SetProperty("double", mitk::DoubleProperty::New(-31.337));
   propList->SetProperty("string", mitk::StringProperty::New("Hello MITK"));
   mitk::Point3D p3d;
   mitk::FillVector3D(p3d, 1.0, 2.2, -3.3);
   propList->SetProperty("p3d", mitk::Point3dProperty::New(p3d));
   mitk::Point3I p3i;
   mitk::FillVector3D(p3i, 1, 2, -3);
   propList->SetProperty("p3i", mitk::Point3iProperty::New(p3i));
   mitk::Point4D p4d;
   mitk::FillVector4D(p4d, 1.5, 2.6, -3.7, 4.44);
   propList->SetProperty("p4d", mitk::Point4dProperty::New(p4d));
   mitk::Vector3D v3d;
   mitk::FillVector3D(v3d, 1.0, 2.2, -3.3);
   propList->SetProperty("v3d", mitk::Vector3DProperty::New(v3d));
   propList->SetProperty("annotation", mitk::AnnotationProperty::New("My Annotation", p3d));
   propList->SetProperty("clipping", mitk::ClippingProperty::New(p3d, v3d));
   propList->SetProperty("color", mitk::ColorProperty::New(1.0, 0.2, 0.2));
   propList->SetProperty("modality", mitk::ModalityProperty::New("Color Doppler"));
   propList->SetProperty("PlaneOrientationProperty",
                         mitk::PlaneOrientationProperty::New("Arrows in positive direction"));
   propList->SetProperty("VtkInterpolationProperty", mitk::VtkInterpolationProperty::New("Gouraud"));
   propList->SetProperty("VtkRepresentationProperty", mitk::VtkRepresentationProperty::New("Surface"));
   propList->SetProperty("VtkResliceInterpolationProperty", mitk::VtkResliceInterpolationProperty::New("Cubic"));
   propList->SetProperty("VtkScalarModeProperty", mitk::VtkScalarModeProperty::New("PointFieldData"));
   propList->SetProperty("VtkVolumeRenderingProperty", mitk::VtkVolumeRenderingProperty::New("COMPOSITE"));
   mitk::BoolLookupTable blt;
   blt.SetTableValue(0, true);
   blt.SetTableValue(1, false);
   blt.SetTableValue(2, true);
   propList->SetProperty("BoolLookupTableProperty", mitk::BoolLookupTableProperty::New(blt));
   mitk::FloatLookupTable flt;
   flt.SetTableValue(0, 3.1);
   flt.SetTableValue(1, 3.3);
   flt.SetTableValue(2, 7.0);
   propList->SetProperty("FloatLookupTableProperty", mitk::FloatLookupTableProperty::New(flt));
   mitk::IntLookupTable ilt;
   ilt.SetTableValue(0, 3);
   ilt.SetTableValue(1, 2);
   ilt.SetTableValue(2, 11);
   propList->SetProperty("IntLookupTableProperty", mitk::IntLookupTableProperty::New(ilt));
   mitk::StringLookupTable slt;
   slt.SetTableValue(0, "Hello");
   slt.SetTableValue(1, "MITK");
   slt.SetTableValue(2, "world");
   propList->SetProperty("StringLookupTableProperty", mitk::StringLookupTableProperty::New(slt));
   propList->SetProperty("GroupTagProperty", mitk::GroupTagProperty::New());
   propList->SetProperty("LevelWindowProperty", mitk::LevelWindowProperty::New(mitk::LevelWindow(100.0, 50.0)));
   mitk::LookupTable::Pointer lt = mitk::LookupTable::New();
   lt->ChangeOpacityForAll(0.25);
   lt->ChangeOpacity(17, 0.88);
   propList->SetProperty("LookupTableProperty", mitk::LookupTableProperty::New(lt));
   propList->SetProperty("StringProperty", mitk::StringProperty::New("Oh why, gruel world"));
 
   MITK_TEST_CONDITION_REQUIRED(propList->GetMap()->size() > 0, "Initialize PropertyList");
 
   TestAllProperties(propList);
 
   /* test default property lists of basedata objects */
   // activate the following tests after MaterialProperty is deleted
 
   mitk::DataNode::Pointer node = mitk::DataNode::New();
   node->SetData(mitk::PointSet::New());
   TestAllProperties(node->GetPropertyList());
   node->SetData(mitk::Image::New());
   TestAllProperties(node->GetPropertyList());
   node->SetData(mitk::Surface::New());
   TestAllProperties(node->GetPropertyList());
   node->SetData(mitk::VtkWidgetRendering::New());
   TestAllProperties(node->GetPropertyList());
 
   MITK_TEST_END();
 }
 
 void TestAllProperties(const mitk::PropertyList *propList)
 {
   assert(propList);
 
   /* try to serialize each property in the list, then deserialize again and check for equality */
   for (auto it = propList->GetMap()->begin();
        it != propList->GetMap()->end();
        ++it)
   {
     const mitk::BaseProperty *prop = it->second;
     // construct name of serializer class
     std::string serializername = std::string(prop->GetNameOfClass()) + "Serializer";
     std::list<itk::LightObject::Pointer> allSerializers =
       itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
     MITK_TEST_CONDITION(allSerializers.size() > 0, std::string("Creating serializers for ") + serializername);
     if (allSerializers.size() == 0)
     {
       MITK_TEST_OUTPUT(<< "serialization not possible, skipping " << prop->GetNameOfClass());
       continue;
     }
     if (allSerializers.size() > 1)
     {
       MITK_TEST_OUTPUT(<< "Warning: " << allSerializers.size() << " serializers found for " << prop->GetNameOfClass()
                        << "testing only the first one.");
     }
     auto *serializer =
       dynamic_cast<mitk::BasePropertySerializer *>(allSerializers.begin()->GetPointer());
     MITK_TEST_CONDITION(serializer != nullptr, serializername + std::string(" is valid"));
     if (serializer != nullptr)
     {
       serializer->SetProperty(prop);
-      TiXmlElement *valueelement = nullptr;
+      tinyxml2::XMLDocument doc;
+      tinyxml2::XMLElement *valueelement = nullptr;
       try
       {
-        valueelement = serializer->Serialize();
+        valueelement = serializer->Serialize(doc);
       }
       catch (...)
       {
       }
       MITK_TEST_CONDITION(valueelement != nullptr, std::string("Serialize property with ") + serializername);
 
       if (valueelement == nullptr)
       {
         MITK_TEST_OUTPUT(<< "serialization failed, skipping deserialization");
         continue;
       }
 
       mitk::BaseProperty::Pointer deserializedProp = serializer->Deserialize(valueelement);
       MITK_TEST_CONDITION(deserializedProp.IsNotNull(), "serializer created valid property");
       if (deserializedProp.IsNotNull())
       {
         MITK_TEST_CONDITION(*(deserializedProp.GetPointer()) == *prop,
                             "deserialized property equals initial property for type " << prop->GetNameOfClass());
       }
     }
     else
     {
       MITK_TEST_OUTPUT(<< "created serializer object is of class "
                        << allSerializers.begin()->GetPointer()->GetNameOfClass())
     }
   } // for all properties
 }
diff --git a/Modules/SceneSerializationBase/test/mitkVectorPropertySerializerTest.cpp b/Modules/SceneSerializationBase/test/mitkVectorPropertySerializerTest.cpp
index b8c3556e0f..ffbee130f4 100644
--- a/Modules/SceneSerializationBase/test/mitkVectorPropertySerializerTest.cpp
+++ b/Modules/SceneSerializationBase/test/mitkVectorPropertySerializerTest.cpp
@@ -1,141 +1,144 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkTestFixture.h"
 #include "mitkTestingMacros.h"
 
 #include "mitkBasePropertySerializer.h"
 #include "mitkVectorProperty.h"
 #include <mitkLexicalCast.h>
 
 #include <limits>
 #include <cmath>
 
 #include "mitkEqual.h"
 
+#include <tinyxml2.h>
+
 /**
  \brief Test for VectorPropertySerializer.
 
  Creates simple std::vector instances, puts them
  into a VectorProperty of appropriate type, then
  asks a serializer to serialize them into XML.
 
  Test expects that there is a deserializer somewhere
  in the system (i.e. registered with the ITK object
  factory. The test further expects that this
  deserializer is able to create a VectorProperty
  from XML and that this VectorProperty equals the
  input of serialization.
 */
 class mitkVectorPropertySerializerTestSuite : public mitk::TestFixture
 {
   CPPUNIT_TEST_SUITE(mitkVectorPropertySerializerTestSuite);
   MITK_TEST(TestSerialize<int>);
   MITK_TEST(TestSerialize<double>);
   MITK_TEST(TestSerializeIntTypedef);
   MITK_TEST(TestSerializeDoubleTypedef);
   CPPUNIT_TEST_SUITE_END();
 
 public:
   void setUp() override {}
   void tearDown() override {}
   template <typename DATATYPE>
   typename mitk::VectorProperty<DATATYPE>::Pointer MakeExampleProperty()
   {
     typename mitk::VectorProperty<DATATYPE>::Pointer vectorProperty = mitk::VectorProperty<DATATYPE>::New();
     std::vector<DATATYPE> data;
     data.push_back(static_cast<DATATYPE>(-918273674.6172838));
     data.push_back(0);
     data.push_back(static_cast<DATATYPE>(+6172838.918273674));
     data.push_back(sqrt(2));
     if (std::numeric_limits<DATATYPE>::has_infinity)
     {
       data.push_back(std::numeric_limits<DATATYPE>::infinity());
       data.push_back(-std::numeric_limits<DATATYPE>::infinity());
     }
     // do NOT test NaN: cannot be == to itself, so cannot be tested like the others
     // NaN is covered in a different test (FloatToStringTest at the time of writing this)
     // data.push_back( std::numeric_limits<DATATYPE>::quiet_NaN() );
     vectorProperty->SetValue(data);
 
     return vectorProperty;
   }
 
   mitk::BaseProperty::Pointer TestSerialize(mitk::BaseProperty *property)
   {
     std::string serializername = std::string(property->GetNameOfClass()) + "Serializer";
 
     std::list<itk::LightObject::Pointer> allSerializers =
       itk::ObjectFactoryBase::CreateAllInstance(serializername.c_str());
     CPPUNIT_ASSERT_EQUAL(size_t(1), allSerializers.size());
 
     auto *serializer =
       dynamic_cast<mitk::BasePropertySerializer *>(allSerializers.begin()->GetPointer());
     CPPUNIT_ASSERT(serializer != nullptr);
     if (!serializer)
       return nullptr;
 
     serializer->SetProperty(property);
-    TiXmlElement *serialization(nullptr);
+    tinyxml2::XMLDocument doc;
+    tinyxml2::XMLElement *serialization(nullptr);
     try
     {
-      serialization = serializer->Serialize();
+      serialization = serializer->Serialize(doc);
     }
     catch (...)
     {
     }
     CPPUNIT_ASSERT(serialization != nullptr);
     if (!serialization)
       return nullptr;
 
     mitk::BaseProperty::Pointer restoredProperty = serializer->Deserialize(serialization);
     CPPUNIT_ASSERT(restoredProperty.IsNotNull());
     return restoredProperty;
   }
 
   template <typename DATATYPE>
   void TestSerialize()
   {
     auto property = MakeExampleProperty<DATATYPE>();
     mitk::BaseProperty::Pointer restored_property = TestSerialize(property);
 
     typename mitk::VectorProperty<DATATYPE>::Pointer restored_vector_property =
       dynamic_cast<mitk::VectorProperty<DATATYPE> *>(restored_property.GetPointer());
     CPPUNIT_ASSERT(restored_vector_property.IsNotNull());
 
     auto orig_vector = property->GetValue();
     auto restored_vector = restored_vector_property->GetValue();
 
     CPPUNIT_ASSERT_EQUAL(orig_vector.size(), restored_vector.size());
     for (unsigned int i = 0; i < orig_vector.size(); ++i)
     {
       // compare using Equal, i.e. with tolerance of mitk::eps
       CPPUNIT_ASSERT_MESSAGE(std::string("Verifying element ") + boost::lexical_cast<std::string>(i),
                              mitk::Equal(orig_vector[i], restored_vector[i]));
     }
   }
 
   void TestSerializeIntTypedef()
   {
     mitk::IntVectorProperty::Pointer intVectorProperty = MakeExampleProperty<int>().GetPointer();
     TestSerialize(intVectorProperty.GetPointer());
   }
 
   void TestSerializeDoubleTypedef()
   {
     mitk::DoubleVectorProperty::Pointer doubleVectorProperty = MakeExampleProperty<double>().GetPointer();
     TestSerialize(doubleVectorProperty.GetPointer());
   }
 
 }; // class
 
 MITK_TEST_SUITE_REGISTRATION(mitkVectorPropertySerializer)
diff --git a/Modules/ToFHardware/mitkAbstractToFDeviceFactory.cpp b/Modules/ToFHardware/mitkAbstractToFDeviceFactory.cpp
index 383feb2ae0..1106656ccb 100644
--- a/Modules/ToFHardware/mitkAbstractToFDeviceFactory.cpp
+++ b/Modules/ToFHardware/mitkAbstractToFDeviceFactory.cpp
@@ -1,82 +1,83 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 #include "mitkAbstractToFDeviceFactory.h"
 #include <mitkCameraIntrinsics.h>
 #include <mitkCameraIntrinsicsProperty.h>
 //Microservices
 #include <usModuleContext.h>
 #include <usGetModuleContext.h>
 #include <usModule.h>
 #include <usModuleResource.h>
 #include <usModuleResourceStream.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 mitk::ToFCameraDevice::Pointer mitk::AbstractToFDeviceFactory::ConnectToFDevice()
 {
   ToFCameraDevice::Pointer device = CreateToFCameraDevice();
   mitk::CameraIntrinsics::Pointer cameraIntrinsics = GetCameraIntrinsics();
   device->SetProperty("CameraIntrinsics", mitk::CameraIntrinsicsProperty::New(cameraIntrinsics));
   m_Devices.push_back(device);
 
   us::ModuleContext* context = us::GetModuleContext();
   us::ServiceProperties deviceProps;
   deviceProps["ToFDeviceName"] = GetCurrentDeviceName();
   m_DeviceRegistrations.insert(std::make_pair(device.GetPointer(), context->RegisterService(device.GetPointer(),deviceProps)));
   return device;
 }
 
 void mitk::AbstractToFDeviceFactory::DisconnectToFDevice(const ToFCameraDevice::Pointer& device)
 {
   std::map<ToFCameraDevice*,us::ServiceRegistration<ToFCameraDevice> >::iterator i = m_DeviceRegistrations.find(device.GetPointer());
   if (i == m_DeviceRegistrations.end()) return;
 
   i->second.Unregister();
   m_DeviceRegistrations.erase(i);
 
   m_Devices.erase(std::remove(m_Devices.begin(), m_Devices.end(), device), m_Devices.end());
 }
 
 size_t mitk::AbstractToFDeviceFactory::GetNumberOfDevices()
 {
   return m_Devices.size();
 }
 
 mitk::CameraIntrinsics::Pointer mitk::AbstractToFDeviceFactory::GetCameraIntrinsics()
 {
   us::ModuleResource resource = GetIntrinsicsResource();
   if (! resource.IsValid())
   {
     MITK_WARN << "Could not load resource '" << resource.GetName() << "'. CameraIntrinsics are invalid!";
   }
 
   // Create ResourceStream from Resource
   us::ModuleResourceStream resStream(resource);
+  std::string resString(std::istreambuf_iterator<char>(resStream), {});
 
   // Parse XML
-  TiXmlDocument xmlDocument;
-  resStream >> xmlDocument;
+  tinyxml2::XMLDocument xmlDocument;
+  xmlDocument.Parse(resString.c_str());
 
   //Retrieve Child Element and convert to CamerIntrinsics
-  TiXmlElement* element = xmlDocument.FirstChildElement();
+  auto* element = xmlDocument.FirstChildElement();
   mitk::CameraIntrinsics::Pointer intrinsics = mitk::CameraIntrinsics::New();
   intrinsics->FromXML(element);
 
   return intrinsics;
 }
 
 us::ModuleResource mitk::AbstractToFDeviceFactory::GetIntrinsicsResource()
 {
   us::Module* module = us::GetModuleContext()->GetModule();
   return module->GetResource("CalibrationFiles/Default_Parameters.xml");
   MITK_WARN << "Loaded Default CameraIntrinsics. Overwrite AbstractToFDeviceFactory::GetIntrinsicsResource() if you want to define your own.";
 }
diff --git a/Modules/TubeGraph/include/mitkTubeGraphIO.h b/Modules/TubeGraph/include/mitkTubeGraphIO.h
index b4a0b0afea..35f4bcaa95 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphIO.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphIO.h
@@ -1,71 +1,69 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef _MITK_TUBE_GRAPH_IO_H_
 #define _MITK_TUBE_GRAPH_IO_H_
 
 #include <mitkAbstractFileIO.h>
 #include <mitkCustomMimeType.h>
 #include <mitkIOMimeTypes.h>
 
 #include "mitkTubeGraph.h"
 
-class TiXmlElement;
-
 namespace mitk
 {
   /**
   * @brief reader and writer for xml representations of mitk::TubeGraph
   *
   * @ingroup IO
   */
   class TubeGraphIO : public mitk::AbstractFileIO
   {
   public:
     TubeGraphIO();
 
     // -------------- AbstractFileReader -------------
 
     using AbstractFileReader::Read;
 
     ConfidenceLevel GetReaderConfidenceLevel() const override;
 
     // -------------- AbstractFileWriter -------------
 
     void Write() override;
     ConfidenceLevel GetWriterConfidenceLevel() const override;
 
     static CustomMimeType TUBEGRAPH_MIMETYPE() // tsf
     {
       CustomMimeType mimeType(TUBEGRAPH_MIMETYPE_NAME());
       mimeType.AddExtension("tsf");
       mimeType.SetCategory("Graphs");
       mimeType.SetComment("MITK Tube Graph Structure File");
       return mimeType;
     }
     static std::string TUBEGRAPH_MIMETYPE_NAME()
     {
       static std::string name = mitk::IOMimeTypes::DEFAULT_BASE_NAME() + ".graphs.tubular-sructure";
       return name;
     }
 
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
   private:
     TubeGraphIO *IOClone() const override;
     TubeGraphIO(const TubeGraphIO &other);
     const BoundingBox::Pointer ComputeBoundingBox(TubeGraph::Pointer graph) const;
   };
 }
 
 #endif //_MITK_SURFACE_VTK_IO_H_
diff --git a/Modules/TubeGraph/src/IO/mitkTubeGraphIO.cpp b/Modules/TubeGraph/src/IO/mitkTubeGraphIO.cpp
index 9d764365d5..9edfb8e2d9 100644
--- a/Modules/TubeGraph/src/IO/mitkTubeGraphIO.cpp
+++ b/Modules/TubeGraph/src/IO/mitkTubeGraphIO.cpp
@@ -1,593 +1,580 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkTubeGraphIO.h"
 
 #include "mitkCircularProfileTubeElement.h"
 #include "mitkTubeGraphDefinitions.h"
 #include "mitkTubeGraphProperty.h"
 
 #include <mitkIOMimeTypes.h>
 
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 #include <vtkMatrix4x4.h>
 
 #include <itksys/SystemTools.hxx>
 
 namespace mitk
 {
   TubeGraphIO::TubeGraphIO(const TubeGraphIO &other) : AbstractFileIO(other) {}
   TubeGraphIO::TubeGraphIO()
     : AbstractFileIO(
         mitk::TubeGraph::GetStaticNameOfClass(), mitk::TubeGraphIO::TUBEGRAPH_MIMETYPE(), "Tube Graph Structure File")
   {
     this->RegisterService();
   }
 
   std::vector<BaseData::Pointer> TubeGraphIO::DoRead()
   {
     std::locale::global(std::locale("C"));
 
     std::vector<itk::SmartPointer<mitk::BaseData>> result;
 
     InputStream stream(this);
+    std::string string(std::istreambuf_iterator<char>(stream), {});
+    tinyxml2::XMLDocument doc;
 
-    TiXmlDocument doc;
-    stream >> doc;
-    if (!doc.Error())
+    if (tinyxml2::XML_SUCCESS == doc.Parse(string.c_str()))
     {
       TubeGraph::Pointer newTubeGraph = TubeGraph::New();
 
-      TiXmlHandle hDoc(&doc);
-      TiXmlElement *pElem;
-      TiXmlHandle hRoot(nullptr);
-
-      pElem = hDoc.FirstChildElement().Element();
-
-      // save this for later
-      hRoot = TiXmlHandle(pElem);
-
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_GEOMETRY).Element();
+      tinyxml2::XMLHandle hDoc(&doc);
+      tinyxml2::XMLHandle hRoot = hDoc.FirstChildElement();
+      tinyxml2::XMLElement *pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_GEOMETRY.c_str()).ToElement();
 
       // read geometry
       mitk::Geometry3D::Pointer geometry = mitk::Geometry3D::New();
       geometry->Initialize();
 
       // read origin
       mitk::Point3D origin;
       double temp = 0;
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_ORIGIN_X, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_X.c_str(), &temp);
       origin[0] = temp;
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Y, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Y.c_str(), &temp);
       origin[1] = temp;
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Z, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Z.c_str(), &temp);
       origin[2] = temp;
       geometry->SetOrigin(origin);
 
       // read spacing
       Vector3D spacing;
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_SPACING_X, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_SPACING_X.c_str(), &temp);
       spacing.SetElement(0, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_SPACING_Y, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Y.c_str(), &temp);
       spacing.SetElement(1, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_SPACING_Z, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Z.c_str(), &temp);
       spacing.SetElement(2, temp);
       geometry->SetSpacing(spacing);
 
       // read transform
       vtkMatrix4x4 *m = vtkMatrix4x4::New();
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_XX, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XX.c_str(), &temp);
       m->SetElement(0, 0, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_XY, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XY.c_str(), &temp);
       m->SetElement(1, 0, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_XZ, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XZ.c_str(), &temp);
       m->SetElement(2, 0, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_YX, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YX.c_str(), &temp);
       m->SetElement(0, 1, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_YY, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YY.c_str(), &temp);
       m->SetElement(1, 1, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_YZ, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YZ.c_str(), &temp);
       m->SetElement(2, 1, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZX, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZX.c_str(), &temp);
       m->SetElement(0, 2, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZY, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZY.c_str(), &temp);
       m->SetElement(1, 2, temp);
-      pElem->Attribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZZ, &temp);
+      pElem->QueryAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZZ.c_str(), &temp);
       m->SetElement(2, 2, temp);
 
       m->SetElement(0, 3, origin[0]);
       m->SetElement(1, 3, origin[1]);
       m->SetElement(2, 3, origin[2]);
       m->SetElement(3, 3, 1);
       geometry->SetIndexToWorldTransformByVtkMatrix(m);
 
       geometry->SetImageGeometry(false);
 
       // read tube graph
 
       // read vertices
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_VERTICES).Element();
+      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_VERTICES.c_str()).ToElement();
       if (pElem != nullptr)
       {
         // walk through the vertices
-        for (TiXmlElement *vertexElement = pElem->FirstChildElement(); vertexElement != nullptr; vertexElement = vertexElement->NextSiblingElement())
+        for (auto *vertexElement = pElem->FirstChildElement(); vertexElement != nullptr; vertexElement = vertexElement->NextSiblingElement())
         {
           int vertexID(0);
           mitk::Point3D coordinate;
           coordinate.Fill(0.0);
           double diameter(0);
 
-          vertexElement->Attribute(mitk::TubeGraphDefinitions::XML_VERTEX_ID, &vertexID);
+          vertexElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_VERTEX_ID.c_str(), &vertexID);
 
-          TiXmlElement *tubeElement = vertexElement->FirstChildElement();
+          auto *tubeElement = vertexElement->FirstChildElement();
 
-          tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X, &temp);
+          tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X.c_str(), &temp);
           coordinate[0] = temp;
-          tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y, &temp);
+          tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y.c_str(), &temp);
           coordinate[1] = temp;
-          tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z, &temp);
+          tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z.c_str(), &temp);
           coordinate[2] = temp;
-          tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER, &diameter);
+          tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(), &diameter);
 
           mitk::TubeGraphVertex vertexData;
           auto *newElement = new mitk::CircularProfileTubeElement(coordinate, diameter);
           vertexData.SetTubeElement(newElement);
 
           mitk::TubeGraph::VertexDescriptorType newVertex = newTubeGraph->AddVertex(vertexData);
           if (static_cast<int>(newVertex) != vertexID)
           {
             MITK_ERROR << "Aborting tube graph creation, different vertex ids.";
             return result;
             ;
           }
         }
       }
 
       // read edges
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_EDGES).Element();
+      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_EDGES.c_str()).ToElement();
       if (pElem != nullptr)
       {
         // walk through the edges
         auto edgeElement = pElem->FirstChildElement();
         for ( ; edgeElement != nullptr; edgeElement = edgeElement->NextSiblingElement())
         {
           int edgeID(0), edgeSourceID(0), edgeTargetID(0);
           mitk::Point3D coordinate;
           double diameter(0);
 
-          edgeElement->Attribute(mitk::TubeGraphDefinitions::XML_EDGE_ID, &edgeID);
-          edgeElement->Attribute(mitk::TubeGraphDefinitions::XML_EDGE_SOURCE_ID, &edgeSourceID);
-          edgeElement->Attribute(mitk::TubeGraphDefinitions::XML_EDGE_TARGET_ID, &edgeTargetID);
+          edgeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_EDGE_ID.c_str(), &edgeID);
+          edgeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_EDGE_SOURCE_ID.c_str(), &edgeSourceID);
+          edgeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_EDGE_TARGET_ID.c_str(), &edgeTargetID);
 
           mitk::TubeGraphEdge edgeData;
 
-          for (TiXmlElement *tubeElement = edgeElement->FirstChildElement(mitk::TubeGraphDefinitions::XML_ELEMENT); tubeElement != nullptr; tubeElement = tubeElement->NextSiblingElement())
+          for (auto *tubeElement = edgeElement->FirstChildElement(mitk::TubeGraphDefinitions::XML_ELEMENT.c_str()); tubeElement != nullptr; tubeElement = tubeElement->NextSiblingElement())
           {
-            tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X, &temp);
+            tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X.c_str(), &temp);
             coordinate[0] = temp;
-            tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y, &temp);
+            tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y.c_str(), &temp);
             coordinate[1] = temp;
-            tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z, &temp);
+            tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z.c_str(), &temp);
             coordinate[2] = temp;
-            tubeElement->Attribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER, &diameter);
+            tubeElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(), &diameter);
 
             auto *newElement = new mitk::CircularProfileTubeElement(coordinate, diameter);
 
             edgeData.AddTubeElement(newElement);
           }
           try
           {
             newTubeGraph->AddEdge(edgeSourceID, edgeTargetID, edgeData);
           }
           catch (const std::runtime_error &error)
           {
             MITK_ERROR << error.what();
             return result;
           }
         }
       }
 
       // Compute bounding box
       BoundingBox::Pointer bb = this->ComputeBoundingBox(newTubeGraph);
       geometry->SetBounds(bb->GetBounds());
 
       MITK_INFO << "Tube Graph read";
       MITK_INFO << "Edge numb:" << newTubeGraph->GetNumberOfEdges()
                 << " Vertices: " << newTubeGraph->GetNumberOfVertices();
 
       MITK_INFO << "Reading tube graph property";
       mitk::TubeGraphProperty::Pointer newProperty = mitk::TubeGraphProperty::New();
 
       // read label groups
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_LABELGROUPS).Element();
+      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_LABELGROUPS.c_str()).ToElement();
       if (pElem != nullptr)
       {
         // walk through the label groups
-        for (TiXmlElement *labelGroupElement = pElem->FirstChildElement(); labelGroupElement != nullptr; labelGroupElement = labelGroupElement->NextSiblingElement())
+        for (auto *labelGroupElement = pElem->FirstChildElement(); labelGroupElement != nullptr; labelGroupElement = labelGroupElement->NextSiblingElement())
         {
           auto *newLabelGroup = new mitk::TubeGraphProperty::LabelGroup();
           const char *labelGroupName;
 
           labelGroupName =
             labelGroupElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME.c_str());
           if (labelGroupName)
             newLabelGroup->labelGroupName = labelGroupName;
 
-          for (TiXmlElement *labelElement = labelGroupElement->FirstChildElement(mitk::TubeGraphDefinitions::XML_LABEL); labelElement != nullptr; labelElement = labelElement->NextSiblingElement())
+          for (auto *labelElement = labelGroupElement->FirstChildElement(mitk::TubeGraphDefinitions::XML_LABEL.c_str()); labelElement != nullptr; labelElement = labelElement->NextSiblingElement())
           {
             auto *newLabel = new mitk::TubeGraphProperty::LabelGroup::Label();
             const char *labelName;
             bool isVisible = true;
             Color color;
 
             labelName = labelElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_LABEL_NAME.c_str());
             if (labelName)
               newLabel->labelName = labelName;
 
-            labelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABEL_VISIBILITY, &temp);
+            labelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_LABEL_VISIBILITY.c_str(), &temp);
             if (temp == 0)
               isVisible = false;
             else
               isVisible = true;
-            labelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_R, &temp);
+            labelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_R.c_str(), &temp);
             color[0] = temp;
-            labelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_G, &temp);
+            labelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_G.c_str(), &temp);
             color[1] = temp;
-            labelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_B, &temp);
+            labelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_B.c_str(), &temp);
             color[2] = temp;
 
             newLabel->isVisible = isVisible;
             newLabel->labelColor = color;
             newLabelGroup->labels.push_back(newLabel);
           }
           newProperty->AddLabelGroup(newLabelGroup, newProperty->GetLabelGroups().size());
         }
       }
       // read attributations
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTIONS).Element();
+      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTIONS.c_str()).ToElement();
       if (pElem != nullptr)
       {
         std::map<TubeGraphProperty::TubeToLabelGroupType, std::string> tubeToLabelsMap;
-        for (TiXmlElement *tubeToLabelElement = pElem->FirstChildElement(); tubeToLabelElement != nullptr; tubeToLabelElement = tubeToLabelElement->NextSiblingElement())
+        for (auto *tubeToLabelElement = pElem->FirstChildElement(); tubeToLabelElement != nullptr; tubeToLabelElement = tubeToLabelElement->NextSiblingElement())
         {
           TubeGraph::TubeDescriptorType tube;
           auto *labelGroup = new mitk::TubeGraphProperty::LabelGroup();
           auto *label = new mitk::TubeGraphProperty::LabelGroup::Label();
 
-          tubeToLabelElement->Attribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1, &temp);
+          tubeToLabelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1.c_str(), &temp);
           tube.first = temp;
-          tubeToLabelElement->Attribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2, &temp);
+          tubeToLabelElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2.c_str(), &temp);
           tube.second = temp;
           const char *labelGroupName =
-            tubeToLabelElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME.c_str());
+            tubeToLabelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME.c_str());
           if (labelGroupName)
             labelGroup = newProperty->GetLabelGroupByName(labelGroupName);
 
           const char *labelName =
-            tubeToLabelElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_LABEL_NAME.c_str());
+            tubeToLabelElement->Attribute(mitk::TubeGraphDefinitions::XML_LABEL_NAME.c_str());
           if (labelName)
             label = newProperty->GetLabelByName(labelGroup, labelName);
 
           if (tube != TubeGraph::ErrorId && labelGroup != nullptr && label != nullptr)
           {
             TubeGraphProperty::TubeToLabelGroupType tubeToLabelGroup(tube, labelGroupName);
             tubeToLabelsMap.insert(
               std::pair<TubeGraphProperty::TubeToLabelGroupType, std::string>(tubeToLabelGroup, labelName));
           }
         }
         if (tubeToLabelsMap.size() > 0)
           newProperty->SetTubesToLabels(tubeToLabelsMap);
       }
       // read annotations
-      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_ANNOTATIONS).Element();
+      pElem = hRoot.FirstChildElement(mitk::TubeGraphDefinitions::XML_ANNOTATIONS.c_str()).ToElement();
       if (pElem != nullptr)
       {
-        for (TiXmlElement *annotationElement = pElem->FirstChildElement(); annotationElement != nullptr; annotationElement = annotationElement->NextSiblingElement())
+        for (auto *annotationElement = pElem->FirstChildElement(); annotationElement != nullptr; annotationElement = annotationElement->NextSiblingElement())
         {
           auto *annotation = new mitk::TubeGraphProperty::Annotation();
-          std::string annotationName;
-          std::string annotationDescription;
           TubeGraph::TubeDescriptorType tube;
 
-          annotationName =
-            annotationElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_ANNOTATION_NAME.c_str());
-          annotation->name = annotationName;
+          const char *annotationName =
+            annotationElement->Attribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_NAME.c_str());
+          annotation->name = nullptr != annotationName ? annotationName : "";
 
-          annotationDescription =
-            annotationElement->Attribute((char *)mitk::TubeGraphDefinitions::XML_ANNOTATION_DESCRIPTION.c_str());
-          annotation->description = annotationDescription;
+          const char *annotationDescription =
+            annotationElement->Attribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_DESCRIPTION.c_str());
+          annotation->description = nullptr != annotationDescription ? annotationDescription : "";
 
-          annotationElement->Attribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1, &temp);
+          annotationElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1.c_str(), &temp);
           tube.first = temp;
-          annotationElement->Attribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2, &temp);
+          annotationElement->QueryAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2.c_str(), &temp);
           tube.second = temp;
 
           if (tube != TubeGraph::ErrorId)
           {
             annotation->tube = tube;
             newProperty->AddAnnotation(annotation);
           }
         }
       }
 
       MITK_INFO << "Tube Graph Property read";
 
       newTubeGraph->SetGeometry(geometry);
       newTubeGraph->SetProperty("Tube Graph.Visualization Information", newProperty);
       result.push_back(newTubeGraph.GetPointer());
     }
-
     else
     {
-      mitkThrow() << "Parsing error at line " << doc.ErrorRow() << ", col " << doc.ErrorCol() << ": "
-                  << doc.ErrorDesc();
+      mitkThrow() << "Parsing error at line " << doc.ErrorLineNum() << ": " << doc.ErrorStr();
     }
     return result;
   }
 
   AbstractFileIO::ConfidenceLevel TubeGraphIO::GetReaderConfidenceLevel() const
   {
     if (AbstractFileIO::GetReaderConfidenceLevel() == Unsupported)
       return Unsupported;
     return Supported;
   }
 
   void TubeGraphIO::Write()
   {
     OutputStream out(this);
 
     if (!out.good())
     {
       mitkThrow() << "Stream not good.";
     }
 
     std::locale previousLocale(out.getloc());
     std::locale I("C");
     out.imbue(I);
 
     const auto *tubeGraph = dynamic_cast<const mitk::TubeGraph *>(this->GetInput());
     // Get geometry of the tube graph
     mitk::Geometry3D::Pointer geometry = dynamic_cast<mitk::Geometry3D *>(tubeGraph->GetGeometry());
     // Get property of the tube graph
     mitk::TubeGraphProperty::Pointer tubeGraphProperty = dynamic_cast<mitk::TubeGraphProperty *>(
       tubeGraph->GetProperty("Tube Graph.Visualization Information").GetPointer());
     // Create XML document
-    TiXmlDocument documentXML;
+    tinyxml2::XMLDocument documentXML;
     { // Begin document
-      auto *declXML = new TiXmlDeclaration("1.0", "", "");
-      documentXML.LinkEndChild(declXML);
+      documentXML.InsertEndChild(documentXML.NewDeclaration());
 
-      auto *mainXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_TUBEGRAPH_FILE);
-      mainXML->SetAttribute(mitk::TubeGraphDefinitions::XML_FILE_VERSION, mitk::TubeGraphDefinitions::VERSION_STRING);
-      documentXML.LinkEndChild(mainXML);
+      auto *mainXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_TUBEGRAPH_FILE.c_str());
+      mainXML->SetAttribute(mitk::TubeGraphDefinitions::XML_FILE_VERSION.c_str(), mitk::TubeGraphDefinitions::VERSION_STRING.c_str());
+      documentXML.InsertEndChild(mainXML);
 
-      auto *geometryXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_GEOMETRY);
+      auto *geometryXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_GEOMETRY.c_str());
       { // begin geometry
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XX, geometry->GetMatrixColumn(0)[0]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XY, geometry->GetMatrixColumn(0)[1]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XZ, geometry->GetMatrixColumn(0)[2]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YX, geometry->GetMatrixColumn(1)[0]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YY, geometry->GetMatrixColumn(1)[1]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YZ, geometry->GetMatrixColumn(1)[2]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZX, geometry->GetMatrixColumn(2)[0]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZY, geometry->GetMatrixColumn(2)[1]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZZ, geometry->GetMatrixColumn(2)[2]);
-
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_X, geometry->GetOrigin()[0]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Y, geometry->GetOrigin()[1]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Z, geometry->GetOrigin()[2]);
-
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_SPACING_X, geometry->GetSpacing()[0]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Y, geometry->GetSpacing()[1]);
-        geometryXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Z, geometry->GetSpacing()[2]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XX.c_str(), geometry->GetMatrixColumn(0)[0]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XY.c_str(), geometry->GetMatrixColumn(0)[1]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_XZ.c_str(), geometry->GetMatrixColumn(0)[2]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YX.c_str(), geometry->GetMatrixColumn(1)[0]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YY.c_str(), geometry->GetMatrixColumn(1)[1]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_YZ.c_str(), geometry->GetMatrixColumn(1)[2]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZX.c_str(), geometry->GetMatrixColumn(2)[0]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZY.c_str(), geometry->GetMatrixColumn(2)[1]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_MATRIX_ZZ.c_str(), geometry->GetMatrixColumn(2)[2]);
+
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_X.c_str(), geometry->GetOrigin()[0]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Y.c_str(), geometry->GetOrigin()[1]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ORIGIN_Z.c_str(), geometry->GetOrigin()[2]);
+
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_SPACING_X.c_str(), geometry->GetSpacing()[0]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Y.c_str(), geometry->GetSpacing()[1]);
+        geometryXML->SetAttribute(mitk::TubeGraphDefinitions::XML_SPACING_Z.c_str(), geometry->GetSpacing()[2]);
 
       } // end geometry
-      mainXML->LinkEndChild(geometryXML);
+      mainXML->InsertEndChild(geometryXML);
 
-      auto *verticesXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_VERTICES);
+      auto *verticesXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_VERTICES.c_str());
       { // begin vertices section
         std::vector<mitk::TubeGraphVertex> vertexVector = tubeGraph->GetVectorOfAllVertices();
         for (unsigned int index = 0; index < vertexVector.size(); index++)
         {
-          auto *vertexXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_VERTEX);
-          vertexXML->SetAttribute(mitk::TubeGraphDefinitions::XML_VERTEX_ID,
-                                  tubeGraph->GetVertexDescriptor(vertexVector[index]));
+          auto *vertexXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_VERTEX.c_str());
+          vertexXML->SetAttribute(mitk::TubeGraphDefinitions::XML_VERTEX_ID.c_str(),
+                                  static_cast<int>(tubeGraph->GetVertexDescriptor(vertexVector[index])));
           // element of each vertex
           const mitk::TubeElement *element = vertexVector[index].GetTubeElement();
-          auto *elementXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ELEMENT);
-          elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X,
+          auto *elementXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ELEMENT.c_str());
+          elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X.c_str(),
                                          element->GetCoordinates().GetElement(0));
-          elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y,
+          elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y.c_str(),
                                          element->GetCoordinates().GetElement(1));
-          elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z,
+          elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z.c_str(),
                                          element->GetCoordinates().GetElement(2));
           if (dynamic_cast<const mitk::CircularProfileTubeElement *>(element))
-            elementXML->SetDoubleAttribute(
-              mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER,
+            elementXML->SetAttribute(
+              mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(),
               (dynamic_cast<const mitk::CircularProfileTubeElement *>(element))->GetDiameter());
           else
-            elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER, 2);
+            elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(), 2);
 
-          vertexXML->LinkEndChild(elementXML);
+          vertexXML->InsertEndChild(elementXML);
 
-          verticesXML->LinkEndChild(vertexXML);
+          verticesXML->InsertEndChild(vertexXML);
         }
       } // end vertices section
-      mainXML->LinkEndChild(verticesXML);
+      mainXML->InsertEndChild(verticesXML);
 
-      auto *edgesXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_EDGES);
+      auto *edgesXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_EDGES.c_str());
       { // begin edges section
         std::vector<mitk::TubeGraphEdge> edgeVector = tubeGraph->GetVectorOfAllEdges();
         for (unsigned int index = 0; index < edgeVector.size(); index++)
         {
-          auto *edgeXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_EDGE);
-          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_ID, index);
+          auto *edgeXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_EDGE.c_str());
+          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_ID.c_str(), index);
           std::pair<mitk::TubeGraphVertex, mitk::TubeGraphVertex> soureTargetPair =
             tubeGraph->GetVerticesOfAnEdge(tubeGraph->GetEdgeDescriptor(edgeVector[index]));
-          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_SOURCE_ID,
-                                tubeGraph->GetVertexDescriptor(soureTargetPair.first));
-          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_TARGET_ID,
-                                tubeGraph->GetVertexDescriptor(soureTargetPair.second));
+          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_SOURCE_ID.c_str(),
+            static_cast<int>(tubeGraph->GetVertexDescriptor(soureTargetPair.first)));
+          edgeXML->SetAttribute(mitk::TubeGraphDefinitions::XML_EDGE_TARGET_ID.c_str(),
+            static_cast<int>(tubeGraph->GetVertexDescriptor(soureTargetPair.second)));
 
           // begin elements of the edge
           std::vector<mitk::TubeElement *> elementVector = edgeVector[index].GetElementVector();
           for (unsigned int elementIndex = 0; elementIndex < elementVector.size(); elementIndex++)
           {
-            auto *elementXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ELEMENT);
-            elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X,
+            auto *elementXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ELEMENT.c_str());
+            elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_X.c_str(),
                                            elementVector[elementIndex]->GetCoordinates().GetElement(0));
-            elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y,
+            elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Y.c_str(),
                                            elementVector[elementIndex]->GetCoordinates().GetElement(1));
-            elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z,
+            elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_Z.c_str(),
                                            elementVector[elementIndex]->GetCoordinates().GetElement(2));
             if (dynamic_cast<const mitk::CircularProfileTubeElement *>(elementVector[elementIndex]))
-              elementXML->SetDoubleAttribute(
-                mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER,
+              elementXML->SetAttribute(
+                mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(),
                 (dynamic_cast<const mitk::CircularProfileTubeElement *>(elementVector[elementIndex]))->GetDiameter());
             else
-              elementXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER, 2);
-            edgeXML->LinkEndChild(elementXML);
-            // elementsXML->LinkEndChild(elementXML);
+              elementXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ELEMENT_DIAMETER.c_str(), 2);
+            edgeXML->InsertEndChild(elementXML);
+            // elementsXML->InsertEndChild(elementXML);
           }
-          edgesXML->LinkEndChild(edgeXML);
+          edgesXML->InsertEndChild(edgeXML);
         }
       } // end edges section
-      mainXML->LinkEndChild(edgesXML);
+      mainXML->InsertEndChild(edgesXML);
 
-      auto *labelGroupsXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_LABELGROUPS);
+      auto *labelGroupsXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_LABELGROUPS.c_str());
       { // begin label group  section
         std::vector<TubeGraphProperty::LabelGroup *> labelGroupVector = tubeGraphProperty->GetLabelGroups();
         for (unsigned int index = 0; index < labelGroupVector.size(); index++)
         {
-          auto *labelGroupXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_LABELGROUP);
-          labelGroupXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME,
-                                      labelGroupVector[index]->labelGroupName);
+          auto *labelGroupXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_LABELGROUP.c_str());
+          labelGroupXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME.c_str(),
+                                      labelGroupVector[index]->labelGroupName.c_str());
           // begin labels of the label group
           std::vector<TubeGraphProperty::LabelGroup::Label *> labelVector = labelGroupVector[index]->labels;
           for (unsigned int labelIndex = 0; labelIndex < labelVector.size(); labelIndex++)
           {
-            auto *labelXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_LABEL);
-            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_NAME, labelVector[labelIndex]->labelName);
-            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_VISIBILITY,
-                                   labelVector[labelIndex]->isVisible);
-            labelXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_R,
+            auto *labelXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_LABEL.c_str());
+            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_NAME.c_str(), labelVector[labelIndex]->labelName.c_str());
+            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_VISIBILITY.c_str(),
+                                   labelVector[labelIndex]->isVisible ? 1 : 0);
+            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_R.c_str(),
                                          labelVector[labelIndex]->labelColor[0]);
-            labelXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_G,
+            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_G.c_str(),
                                          labelVector[labelIndex]->labelColor[1]);
-            labelXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_B,
+            labelXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_COLOR_B.c_str(),
                                          labelVector[labelIndex]->labelColor[2]);
-            labelGroupXML->LinkEndChild(labelXML);
+            labelGroupXML->InsertEndChild(labelXML);
           }
-          labelGroupsXML->LinkEndChild(labelGroupXML);
+          labelGroupsXML->InsertEndChild(labelGroupXML);
         }
       } // end labe group section
-      mainXML->LinkEndChild(labelGroupsXML);
+      mainXML->InsertEndChild(labelGroupsXML);
 
-      auto *attributionsXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTIONS);
+      auto *attributionsXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTIONS.c_str());
       { // begin attributions section
         std::map<mitk::TubeGraphProperty::TubeToLabelGroupType, std::string> tubeToLabelGroup =
           tubeGraphProperty->GetTubesToLabels();
         for (auto it =
                tubeToLabelGroup.begin();
              it != tubeToLabelGroup.end();
              it++)
         {
-          auto *attributXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTION);
-          attributXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1, it->first.first.first);
-          attributXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2, it->first.first.second);
-          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME, it->first.second);
-          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_NAME, it->second);
-          attributionsXML->LinkEndChild(attributXML);
+          auto *attributXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ATTRIBUTION.c_str());
+          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1.c_str(), static_cast<int>(it->first.first.first));
+          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2.c_str(), static_cast<int>(it->first.first.second));
+          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABELGROUP_NAME.c_str(), it->first.second.c_str());
+          attributXML->SetAttribute(mitk::TubeGraphDefinitions::XML_LABEL_NAME.c_str(), it->second.c_str());
+          attributionsXML->InsertEndChild(attributXML);
         }
 
       } // end attributions section
-      mainXML->LinkEndChild(attributionsXML);
+      mainXML->InsertEndChild(attributionsXML);
 
-      auto *annotationsXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ANNOTATIONS);
+      auto *annotationsXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ANNOTATIONS.c_str());
       { // begin annotations section
         std::vector<mitk::TubeGraphProperty::Annotation *> annotations = tubeGraphProperty->GetAnnotations();
         for (unsigned int index = 0; index < annotations.size(); index++)
         {
-          auto *annotationXML = new TiXmlElement(mitk::TubeGraphDefinitions::XML_ANNOTATION);
-          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_NAME, annotations[index]->name);
-          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_DESCRIPTION,
-                                      annotations[index]->description);
-          annotationXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1, annotations[index]->tube.first);
-          annotationXML->SetDoubleAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2, annotations[index]->tube.second);
-
-          annotationsXML->LinkEndChild(annotationXML);
+          auto *annotationXML = documentXML.NewElement(mitk::TubeGraphDefinitions::XML_ANNOTATION.c_str());
+          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_NAME.c_str(), annotations[index]->name.c_str());
+          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_ANNOTATION_DESCRIPTION.c_str(), annotations[index]->description.c_str());
+          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_1.c_str(), static_cast<int>(annotations[index]->tube.first));
+          annotationXML->SetAttribute(mitk::TubeGraphDefinitions::XML_TUBE_ID_2.c_str(), static_cast<int>(annotations[index]->tube.second));
+
+          annotationsXML->InsertEndChild(annotationXML);
         }
       } // end annotations section
-      mainXML->LinkEndChild(annotationsXML);
+      mainXML->InsertEndChild(annotationsXML);
     } // end document
 
-    TiXmlPrinter printer;
-    printer.SetStreamPrinting();
-    documentXML.Accept(&printer);
-    out << printer.Str();
+    tinyxml2::XMLPrinter printer;
+    documentXML.Print(&printer);
+
+    out << printer.CStr();
   }
 
   AbstractFileIO::ConfidenceLevel TubeGraphIO::GetWriterConfidenceLevel() const
   {
     if (AbstractFileIO::GetWriterConfidenceLevel() == Unsupported)
       return Unsupported;
     return Supported;
   }
 
   TubeGraphIO *TubeGraphIO::IOClone() const { return new TubeGraphIO(*this); }
 }
 
 const mitk::BoundingBox::Pointer mitk::TubeGraphIO::ComputeBoundingBox(mitk::TubeGraph::Pointer graph) const
 {
   BoundingBox::Pointer boundingBox = BoundingBox::New();
   BoundingBox::PointIdentifier pointid = 0;
   BoundingBox::PointsContainer::Pointer pointscontainer = BoundingBox::PointsContainer::New();
 
   ScalarType nullpoint[] = {0, 0, 0};
   BoundingBox::PointType p(nullpoint);
 
   // traverse the tree and add each point to the pointscontainer
 
   mitk::Point3D pos;
 
   std::vector<mitk::TubeGraphVertex> vertexVector = graph->GetVectorOfAllVertices();
   for (auto vertex = vertexVector.begin(); vertex != vertexVector.end();
        ++vertex)
   {
     pos = vertex->GetTubeElement()->GetCoordinates();
     p[0] = pos[0];
     p[1] = pos[1];
     p[2] = pos[2];
     pointscontainer->InsertElement(pointid++, p);
   }
 
   std::vector<mitk::TubeGraphEdge> edgeVector = graph->GetVectorOfAllEdges();
 
   for (auto edge = edgeVector.begin(); edge != edgeVector.end(); ++edge)
   {
     std::vector<mitk::TubeElement *> allElements = edge->GetElementVector();
     for (unsigned int index = 0; index < edge->GetNumberOfElements(); index++)
     {
       pos = allElements[index]->GetCoordinates();
       p[0] = pos[0];
       p[1] = pos[1];
       p[2] = pos[2];
       pointscontainer->InsertElement(pointid++, p);
     }
   }
 
   boundingBox->SetPoints(pointscontainer);
   boundingBox->ComputeBoundingBox();
 
   return boundingBox;
 }
diff --git a/Modules/US/CMakeLists.txt b/Modules/US/CMakeLists.txt
index 97b6d418c7..2f39a220c2 100644
--- a/Modules/US/CMakeLists.txt
+++ b/Modules/US/CMakeLists.txt
@@ -1,15 +1,21 @@
 MITK_CREATE_MODULE(
   INCLUDE_DIRS USControlInterfaces USFilters USModel
   INTERNAL_INCLUDE_DIRS ${INCLUDE_DIRS_INTERNAL}
-  PACKAGE_DEPENDS Poco PRIVATE tinyxml
+  PACKAGE_DEPENDS Poco PRIVATE tinyxml2|tinyxml2
   DEPENDS MitkOpenCVVideoSupport MitkQtWidgetsExt MitkIGTBase MitkOpenIGTLink
 )
 
+if(TARGET ${MODULE_TARGET})
+  target_link_libraries(${MODULE_TARGET}
+    PRIVATE tinyxml2::tinyxml2
+  )
+endif()
+
 ## create US config
 #CONFIGURE_FILE(mitkUSConfig.h.in ${PROJECT_BINARY_DIR}/mitkUSConfig.h @ONLY)
 
 ADD_SUBDIRECTORY(USHardwareTelemed)
 ADD_SUBDIRECTORY(USHardwareDiPhAS)
 ADD_SUBDIRECTORY(USNavigation)
 
 ADD_SUBDIRECTORY(Testing)
diff --git a/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.cpp b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.cpp
new file mode 100644
index 0000000000..7eee5038e0
--- /dev/null
+++ b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.cpp
@@ -0,0 +1,50 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#include "mitkUSDeviceReaderWriterConstants.h"
+
+namespace mitk
+{
+  const char* USDeviceReaderWriterConstants::TAG_ULTRASOUNDDEVICE = "ULTRASOUNDDEVICE";
+  const char* USDeviceReaderWriterConstants::TAG_GENERALSETTINGS = "GENERALSETTINGS";
+  const char* USDeviceReaderWriterConstants::TAG_PROBES = "PROBES";
+  const char* USDeviceReaderWriterConstants::TAG_PROBE = "PROBE";
+  const char* USDeviceReaderWriterConstants::TAG_DEPTHS = "DEPTHS";
+  const char* USDeviceReaderWriterConstants::TAG_DEPTH = "DEPTH";
+  const char* USDeviceReaderWriterConstants::TAG_SPACING = "SPACING";
+  const char* USDeviceReaderWriterConstants::TAG_CROPPING = "CROPPING";
+
+  const char* USDeviceReaderWriterConstants::ATTR_FILEVERS = "filevers";
+  const char* USDeviceReaderWriterConstants::ATTR_TYPE = "type";
+  const char* USDeviceReaderWriterConstants::ATTR_HOST = "host";
+  const char* USDeviceReaderWriterConstants::ATTR_PORT = "port";
+  const char* USDeviceReaderWriterConstants::ATTR_SERVER = "server";
+  const char* USDeviceReaderWriterConstants::ATTR_NAME = "name";
+  const char* USDeviceReaderWriterConstants::ATTR_MANUFACTURER = "manufacturer";
+  const char* USDeviceReaderWriterConstants::ATTR_MODEL = "model";
+  const char* USDeviceReaderWriterConstants::ATTR_COMMENT = "comment";
+  const char* USDeviceReaderWriterConstants::ATTR_IMAGESTREAMS = "imagestreams";
+  const char* USDeviceReaderWriterConstants::ATTR_GREYSCALE = "greyscale";
+  const char* USDeviceReaderWriterConstants::ATTR_RESOLUTIONOVERRIDE = "resolutionOverride";
+  const char* USDeviceReaderWriterConstants::ATTR_RESOLUTIONWIDTH = "resolutionWidth";
+  const char* USDeviceReaderWriterConstants::ATTR_RESOLUTIONHEIGHT = "resolutionHeight";
+  const char* USDeviceReaderWriterConstants::ATTR_SOURCEID = "sourceID";
+  const char* USDeviceReaderWriterConstants::ATTR_FILEPATH = "filepath";
+  const char* USDeviceReaderWriterConstants::ATTR_OPENCVPORT = "opencvPort";
+  const char* USDeviceReaderWriterConstants::ATTR_DEPTH = "depth";
+  const char* USDeviceReaderWriterConstants::ATTR_X = "x";
+  const char* USDeviceReaderWriterConstants::ATTR_Y = "y";
+  const char* USDeviceReaderWriterConstants::ATTR_TOP = "top";
+  const char* USDeviceReaderWriterConstants::ATTR_BOTTOM = "bottom";
+  const char* USDeviceReaderWriterConstants::ATTR_LEFT = "left";
+  const char* USDeviceReaderWriterConstants::ATTR_RIGHT = "right";
+}
diff --git a/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
index 3c01c2dd6d..7307f04628 100644
--- a/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
+++ b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
@@ -1,52 +1,57 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
 #define mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
 
-const static char* TAG_ULTRASOUNDDEVICE = "ULTRASOUNDDEVICE";
-const static char* TAG_GENERALSETTINGS = "GENERALSETTINGS";
-const static char* TAG_PROBES = "PROBES";
-const static char* TAG_PROBE = "PROBE";
-const static char* TAG_DEPTHS = "DEPTHS";
-const static char* TAG_DEPTH = "DEPTH";
-const static char* TAG_SPACING = "SPACING";
-const static char* TAG_CROPPING = "CROPPING";
-
-const static char* ATTR_FILEVERS = "filevers";
-const static char* ATTR_TYPE = "type";
-const static char* ATTR_HOST = "host";
-const static char* ATTR_PORT = "port";
-const static char* ATTR_SERVER = "server";
-const static char* ATTR_NAME = "name";
-const static char* ATTR_MANUFACTURER = "manufacturer";
-const static char* ATTR_MODEL = "model";
-const static char* ATTR_COMMENT = "comment";
-const static char* ATTR_IMAGESTREAMS = "imagestreams";
-const static char* ATTR_GREYSCALE = "greyscale";
-const static char* ATTR_RESOLUTIONOVERRIDE = "resolutionOverride";
-const static char* ATTR_RESOLUTIONWIDTH = "resolutionWidth";
-const static char* ATTR_RESOLUTIONHEIGHT = "resolutionHeight";
-const static char* ATTR_SOURCEID = "sourceID";
-const static char* ATTR_FILEPATH = "filepath";
-const static char* ATTR_OPENCVPORT = "opencvPort";
-const static char* ATTR_DEPTH = "depth";
-const static char* ATTR_X = "x";
-const static char* ATTR_Y = "y";
-const static char* ATTR_TOP = "top";
-const static char* ATTR_BOTTOM = "bottom";
-const static char* ATTR_LEFT = "left";
-const static char* ATTR_RIGHT = "right";
-
+namespace mitk
+{
+  struct USDeviceReaderWriterConstants
+  {
+    static const char* TAG_ULTRASOUNDDEVICE;
+    static const char* TAG_GENERALSETTINGS;
+    static const char* TAG_PROBES;
+    static const char* TAG_PROBE;
+    static const char* TAG_DEPTHS;
+    static const char* TAG_DEPTH;
+    static const char* TAG_SPACING;
+    static const char* TAG_CROPPING;
+
+    static const char* ATTR_FILEVERS;
+    static const char* ATTR_TYPE;
+    static const char* ATTR_HOST;
+    static const char* ATTR_PORT;
+    static const char* ATTR_SERVER;
+    static const char* ATTR_NAME;
+    static const char* ATTR_MANUFACTURER;
+    static const char* ATTR_MODEL;
+    static const char* ATTR_COMMENT;
+    static const char* ATTR_IMAGESTREAMS;
+    static const char* ATTR_GREYSCALE;
+    static const char* ATTR_RESOLUTIONOVERRIDE;
+    static const char* ATTR_RESOLUTIONWIDTH;
+    static const char* ATTR_RESOLUTIONHEIGHT;
+    static const char* ATTR_SOURCEID;
+    static const char* ATTR_FILEPATH;
+    static const char* ATTR_OPENCVPORT;
+    static const char* ATTR_DEPTH;
+    static const char* ATTR_X;
+    static const char* ATTR_Y;
+    static const char* ATTR_TOP;
+    static const char* ATTR_BOTTOM;
+    static const char* ATTR_LEFT;
+    static const char* ATTR_RIGHT;
+  };
+}
 
 #endif // mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
diff --git a/Modules/US/USModel/mitkUSDeviceReaderXML.cpp b/Modules/US/USModel/mitkUSDeviceReaderXML.cpp
index 250b7af835..9c6b2ade02 100644
--- a/Modules/US/USModel/mitkUSDeviceReaderXML.cpp
+++ b/Modules/US/USModel/mitkUSDeviceReaderXML.cpp
@@ -1,204 +1,217 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkUSDeviceReaderWriterConstants.h"
 #include "mitkUSDeviceReaderXML.h"
 #include <mitkIGTMimeTypes.h>
 #include <mitkLocaleSwitch.h>
 
 #include <mitkUSVideoDevice.h>
 
 // Third Party
 #include <itksys/SystemTools.hxx>
 #include <fstream>
-#include <tinyxml.h>
+#include <tinyxml2.h>
+
+namespace
+{
+  std::string ReadStringAttribute(const tinyxml2::XMLElement* elem, const char* name)
+  {
+    const char* attrib = elem->Attribute(name);
+
+    return attrib != nullptr
+      ? attrib
+      : "";
+  }
+}
 
 mitk::USDeviceReaderXML::USDeviceReaderXML() : AbstractFileReader(
   mitk::IGTMimeTypes::USDEVICEINFORMATIONXML_MIMETYPE(),
   "MITK USDevice Reader (XML)"), m_Filename("")
 {
   RegisterService();
 }
 
 mitk::USDeviceReaderXML::~USDeviceReaderXML()
 {
 }
 
 mitk::USDeviceReaderXML::USDeviceConfigData &mitk::USDeviceReaderXML::GetUSDeviceConfigData()
 {
   return m_DeviceConfig;
 }
 
 mitk::USDeviceReaderXML::USDeviceReaderXML(const mitk::USDeviceReaderXML& other) : AbstractFileReader(other)
 {
 }
 
 mitk::USDeviceReaderXML* mitk::USDeviceReaderXML::Clone() const
 {
   return new USDeviceReaderXML(*this);
 }
 
 
 
 
 std::vector<itk::SmartPointer<mitk::BaseData>> mitk::USDeviceReaderXML::DoRead()
 {
   MITK_WARN << "This method is not implemented. \
   Please use the method ReadUltrasoundDeviceConfiguration() instead.";
   std::vector<mitk::BaseData::Pointer> result;
   return result;
 }
 
 bool mitk::USDeviceReaderXML::ReadUltrasoundDeviceConfiguration()
 {
   MITK_INFO << "Try to start reading xml device configuration...";
   if (m_Filename == "")
   {
     MITK_WARN << "Cannot read file - empty filename!";
     return false;
   }
 
-  TiXmlDocument document(m_Filename);
-  if (!document.LoadFile())
+  tinyxml2::XMLDocument document;
+  if (tinyxml2::XML_SUCCESS != document.LoadFile(m_Filename.c_str()))
   {
     MITK_ERROR << "Error when opening and reading file :" << m_Filename;
     return false;
   }
 
-  TiXmlHandle documentHandle(&document);
-  TiXmlElement* ultrasoundDeviceTag = documentHandle.FirstChildElement(TAG_ULTRASOUNDDEVICE).ToElement();
+  tinyxml2::XMLHandle documentHandle(&document);
+  auto* ultrasoundDeviceTag = documentHandle.FirstChildElement(USDeviceReaderWriterConstants::TAG_ULTRASOUNDDEVICE).ToElement();
   if (ultrasoundDeviceTag == nullptr)
   {
     MITK_ERROR << "Error parsing the file :" << m_Filename << std::endl << "Wrong xml format structure.";
     return false;
   }
 
   //Extract attribute information of the ULTRASOUNDDEVICE-Tag:
   this->ExtractAttributeInformationOfUltrasoundDeviceTag(ultrasoundDeviceTag);
 
-  TiXmlElement* generalSettingsTag = documentHandle.FirstChildElement(TAG_ULTRASOUNDDEVICE).FirstChildElement(TAG_GENERALSETTINGS).ToElement();
+  auto* generalSettingsTag = documentHandle.FirstChildElement(USDeviceReaderWriterConstants::TAG_ULTRASOUNDDEVICE).FirstChildElement(USDeviceReaderWriterConstants::TAG_GENERALSETTINGS).ToElement();
   if (generalSettingsTag == nullptr)
   {
     MITK_ERROR << "Error parsing the GENERALSETTINGS-Tag in the file :" << m_Filename;
     return false;
   }
 
   //Extract attribute information of the GENERALSETTINGS-Tag:
   this->ExtractAttributeInformationOfGeneralSettingsTag(generalSettingsTag);
 
-  TiXmlElement* probesTag = documentHandle.FirstChildElement(TAG_ULTRASOUNDDEVICE).FirstChildElement(TAG_PROBES).ToElement();
+  auto* probesTag = documentHandle.FirstChildElement(USDeviceReaderWriterConstants::TAG_ULTRASOUNDDEVICE).FirstChildElement(USDeviceReaderWriterConstants::TAG_PROBES).ToElement();
   if (probesTag == nullptr)
   {
     MITK_ERROR << "Error: PROBES-Tag was not found in the file :" << m_Filename << "Therefore, creating default probe.";
     //Create default ultrasound probe:
     mitk::USProbe::Pointer ultrasoundProbeDefault = mitk::USProbe::New();
     ultrasoundProbeDefault->SetName("default");
     ultrasoundProbeDefault->SetDepth(0);
     m_DeviceConfig.probes.push_back(ultrasoundProbeDefault);
     return true;
   }
 
   //Extract all saved and configured probes of the USDevice:
-  for (TiXmlElement* probeTag = probesTag->FirstChildElement(TAG_PROBE);
+  for (auto* probeTag = probesTag->FirstChildElement(USDeviceReaderWriterConstants::TAG_PROBE);
     probeTag != nullptr; probeTag = probeTag->NextSiblingElement())
   {
     this->ExtractProbe(probeTag);
   }
   return true;
 }
 
 void mitk::USDeviceReaderXML::SetFilename(std::string filename)
 {
   m_Filename = filename;
 }
 
-void mitk::USDeviceReaderXML::ExtractAttributeInformationOfUltrasoundDeviceTag(TiXmlElement *ultrasoundTag)
+void mitk::USDeviceReaderXML::ExtractAttributeInformationOfUltrasoundDeviceTag(const tinyxml2::XMLElement *ultrasoundTag)
 {
-  ultrasoundTag->QueryDoubleAttribute(ATTR_FILEVERS, &m_DeviceConfig.fileversion);
-  ultrasoundTag->QueryStringAttribute(ATTR_TYPE, &m_DeviceConfig.deviceType);
-  ultrasoundTag->QueryStringAttribute(ATTR_NAME, &m_DeviceConfig.deviceName);
-  ultrasoundTag->QueryStringAttribute(ATTR_MANUFACTURER, &m_DeviceConfig.manufacturer);
-  ultrasoundTag->QueryStringAttribute(ATTR_MODEL, &m_DeviceConfig.model);
-  ultrasoundTag->QueryStringAttribute(ATTR_COMMENT, &m_DeviceConfig.comment);
-  ultrasoundTag->QueryIntAttribute(ATTR_IMAGESTREAMS, &m_DeviceConfig.numberOfImageStreams);
-  ultrasoundTag->QueryStringAttribute(ATTR_HOST, &m_DeviceConfig.host);
-  ultrasoundTag->QueryIntAttribute(ATTR_PORT, &m_DeviceConfig.port);
-  ultrasoundTag->QueryBoolAttribute(ATTR_SERVER, &m_DeviceConfig.server);
+  ultrasoundTag->QueryDoubleAttribute(USDeviceReaderWriterConstants::ATTR_FILEVERS, &m_DeviceConfig.fileversion);
+  ultrasoundTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_IMAGESTREAMS, &m_DeviceConfig.numberOfImageStreams);
+  ultrasoundTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_PORT, &m_DeviceConfig.port);
+  ultrasoundTag->QueryBoolAttribute(USDeviceReaderWriterConstants::ATTR_SERVER, &m_DeviceConfig.server);
+
+  m_DeviceConfig.deviceType = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_TYPE);
+  m_DeviceConfig.deviceName = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_TYPE);
+  m_DeviceConfig.manufacturer = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_TYPE);
+  m_DeviceConfig.model = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_TYPE);
+  m_DeviceConfig.comment = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_TYPE);
+  m_DeviceConfig.host = ReadStringAttribute(ultrasoundTag, USDeviceReaderWriterConstants::ATTR_HOST);
 }
 
-void mitk::USDeviceReaderXML::ExtractAttributeInformationOfGeneralSettingsTag(TiXmlElement *generalSettingsTag)
+void mitk::USDeviceReaderXML::ExtractAttributeInformationOfGeneralSettingsTag(const tinyxml2::XMLElement *generalSettingsTag)
 {
-  generalSettingsTag->QueryBoolAttribute(ATTR_GREYSCALE, &m_DeviceConfig.useGreyscale);
-  generalSettingsTag->QueryBoolAttribute(ATTR_RESOLUTIONOVERRIDE, &m_DeviceConfig.useResolutionOverride);
-  generalSettingsTag->QueryIntAttribute(ATTR_RESOLUTIONHEIGHT, &m_DeviceConfig.resolutionHeight);
-  generalSettingsTag->QueryIntAttribute(ATTR_RESOLUTIONWIDTH, &m_DeviceConfig.resolutionWidth);
-  generalSettingsTag->QueryIntAttribute(ATTR_SOURCEID, &m_DeviceConfig.sourceID);
-  generalSettingsTag->QueryStringAttribute(ATTR_FILEPATH, &m_DeviceConfig.filepathVideoSource);
-  generalSettingsTag->QueryIntAttribute(ATTR_OPENCVPORT, &m_DeviceConfig.opencvPort);
+  generalSettingsTag->QueryBoolAttribute(USDeviceReaderWriterConstants::ATTR_GREYSCALE, &m_DeviceConfig.useGreyscale);
+  generalSettingsTag->QueryBoolAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONOVERRIDE, &m_DeviceConfig.useResolutionOverride);
+  generalSettingsTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONHEIGHT, &m_DeviceConfig.resolutionHeight);
+  generalSettingsTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONWIDTH, &m_DeviceConfig.resolutionWidth);
+  generalSettingsTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_SOURCEID, &m_DeviceConfig.sourceID);
+  generalSettingsTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_OPENCVPORT, &m_DeviceConfig.opencvPort);
+
+  m_DeviceConfig.filepathVideoSource = ReadStringAttribute(generalSettingsTag, USDeviceReaderWriterConstants::ATTR_FILEPATH);
 }
 
-void mitk::USDeviceReaderXML::ExtractProbe(TiXmlElement *probeTag)
+void mitk::USDeviceReaderXML::ExtractProbe(const tinyxml2::XMLElement *probeTag)
 {
   mitk::USProbe::Pointer ultrasoundProbe = mitk::USProbe::New();
-  std::string probeName;
-  probeTag->QueryStringAttribute(ATTR_NAME, &probeName);
+  auto probeName = ReadStringAttribute(probeTag, USDeviceReaderWriterConstants::ATTR_NAME);
   ultrasoundProbe->SetName(probeName);
 
-  TiXmlElement* depthsTag = probeTag->FirstChildElement(TAG_DEPTHS);
+  auto* depthsTag = probeTag->FirstChildElement(USDeviceReaderWriterConstants::TAG_DEPTHS);
   if (depthsTag != nullptr)
   {
-    for (TiXmlElement* depthTag = depthsTag->FirstChildElement(TAG_DEPTH);
+    for (auto* depthTag = depthsTag->FirstChildElement(USDeviceReaderWriterConstants::TAG_DEPTH);
       depthTag != nullptr; depthTag = depthTag->NextSiblingElement())
     {
       int depth = 0;
       mitk::Vector3D spacing;
       spacing[0] = 1;
       spacing[1] = 1;
       spacing[2] = 1;
 
-      depthTag->QueryIntAttribute(ATTR_DEPTH, &depth);
+      depthTag->QueryIntAttribute(USDeviceReaderWriterConstants::ATTR_DEPTH, &depth);
 
-      TiXmlElement* spacingTag = depthTag->FirstChildElement(TAG_SPACING);
+      auto* spacingTag = depthTag->FirstChildElement(USDeviceReaderWriterConstants::TAG_SPACING);
       if (spacingTag != nullptr)
       {
-        spacingTag->QueryDoubleAttribute(ATTR_X, &spacing[0]);
-        spacingTag->QueryDoubleAttribute(ATTR_Y, &spacing[1]);
+        spacingTag->QueryDoubleAttribute(USDeviceReaderWriterConstants::ATTR_X, &spacing[0]);
+        spacingTag->QueryDoubleAttribute(USDeviceReaderWriterConstants::ATTR_Y, &spacing[1]);
       }
 
       ultrasoundProbe->SetDepthAndSpacing(depth, spacing);
     }
   }
   else
   {
     MITK_ERROR << "Error: DEPTHS-Tag was not found in the file :" << m_Filename
       << "Therefore, creating default depth [0] and spacing [1,1,1] for the probe.";
     ultrasoundProbe->SetDepth(0);
   }
 
   unsigned int croppingTop = 0;
   unsigned int croppingBottom = 0;
   unsigned int croppingLeft = 0;
   unsigned int croppingRight = 0;
 
-  TiXmlElement* croppingTag = probeTag->FirstChildElement(TAG_CROPPING);
+  auto* croppingTag = probeTag->FirstChildElement(USDeviceReaderWriterConstants::TAG_CROPPING);
   if (croppingTag != nullptr)
   {
-    croppingTag->QueryUnsignedAttribute(ATTR_TOP, &croppingTop);
-    croppingTag->QueryUnsignedAttribute(ATTR_BOTTOM, &croppingBottom);
-    croppingTag->QueryUnsignedAttribute(ATTR_LEFT, &croppingLeft);
-    croppingTag->QueryUnsignedAttribute(ATTR_RIGHT, &croppingRight);
+    croppingTag->QueryUnsignedAttribute(USDeviceReaderWriterConstants::ATTR_TOP, &croppingTop);
+    croppingTag->QueryUnsignedAttribute(USDeviceReaderWriterConstants::ATTR_BOTTOM, &croppingBottom);
+    croppingTag->QueryUnsignedAttribute(USDeviceReaderWriterConstants::ATTR_LEFT, &croppingLeft);
+    croppingTag->QueryUnsignedAttribute(USDeviceReaderWriterConstants::ATTR_RIGHT, &croppingRight);
   }
 
   ultrasoundProbe->SetProbeCropping(croppingTop, croppingBottom, croppingLeft, croppingRight);
   m_DeviceConfig.probes.push_back(ultrasoundProbe);
 }
diff --git a/Modules/US/USModel/mitkUSDeviceReaderXML.h b/Modules/US/USModel/mitkUSDeviceReaderXML.h
index a81663d7c2..ca168add34 100644
--- a/Modules/US/USModel/mitkUSDeviceReaderXML.h
+++ b/Modules/US/USModel/mitkUSDeviceReaderXML.h
@@ -1,103 +1,104 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
 #define mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
 
 #include <MitkUSExports.h>
 
 #include <mitkAbstractFileReader.h>
 #include <mitkUSProbe.h>
 
-class TiXmlElement;
-class TiXmlNode;
+namespace tinyxml2 {
+  class XMLElement;
+}
 
 namespace mitk {
 
   class MITKUS_EXPORT USDeviceReaderXML : public AbstractFileReader
   {
   public:
     USDeviceReaderXML();
     ~USDeviceReaderXML() override;
 
     using AbstractFileReader::Read;
 
     bool ReadUltrasoundDeviceConfiguration();
 
     void SetFilename(std::string filename);
 
     typedef struct USDeviceConfigData_
     {
       double fileversion;
       std::string deviceType;
       std::string deviceName;
       std::string manufacturer;
       std::string model;
       std::string comment;
       std::string host;
       int port;
       bool server;
       int numberOfImageStreams;
 
       bool useGreyscale;
       bool useResolutionOverride;
       int resolutionWidth;
       int resolutionHeight;
       int sourceID;
       std::string filepathVideoSource;
       int opencvPort;
 
       std::vector <mitk::USProbe::Pointer> probes;
 
       USDeviceConfigData_()
         : fileversion(0), deviceType("Unknown"), deviceName("Unknown"),
           manufacturer("Unknown"), comment(""), host("localhost"),
           port(18944), server(false), numberOfImageStreams(1),
           useGreyscale(true), useResolutionOverride(true),
           resolutionWidth(640), resolutionHeight(480), sourceID(0),
           filepathVideoSource(""), opencvPort(0)
         { };
 
     }USDeviceConfigData;
 
     USDeviceConfigData &GetUSDeviceConfigData();
 
   protected:
     std::vector<itk::SmartPointer<BaseData>> DoRead() override;
 
     USDeviceReaderXML(const USDeviceReaderXML& other);
     mitk::USDeviceReaderXML* Clone() const override;
 
     /**
     * \brief Extracts all stored attribute information of the ULTRASOUNDDEVICE-Tag.
     */
-    void ExtractAttributeInformationOfUltrasoundDeviceTag(TiXmlElement *element);
+    void ExtractAttributeInformationOfUltrasoundDeviceTag(const tinyxml2::XMLElement *element);
 
     /**
     * \brief Extracts all stored attribute information of the GENERALSETTINGS-Tag.
     */
-    void ExtractAttributeInformationOfGeneralSettingsTag(TiXmlElement *element);
+    void ExtractAttributeInformationOfGeneralSettingsTag(const tinyxml2::XMLElement *element);
 
     /**
     * \brief Extracts all stored information of a single ultrasound probe.
     */
-    void ExtractProbe(TiXmlElement *element);
+    void ExtractProbe(const tinyxml2::XMLElement *element);
 
   private:
     std::string m_Filename;
     USDeviceConfigData m_DeviceConfig;
   };
 
 } // namespace mitk
 
 #endif // mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
diff --git a/Modules/US/USModel/mitkUSDeviceWriterXML.cpp b/Modules/US/USModel/mitkUSDeviceWriterXML.cpp
index d0be517a1e..6d56cc163c 100644
--- a/Modules/US/USModel/mitkUSDeviceWriterXML.cpp
+++ b/Modules/US/USModel/mitkUSDeviceWriterXML.cpp
@@ -1,161 +1,157 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 // MITK
 #include "mitkUSDeviceReaderWriterConstants.h"
 #include "mitkUSDeviceWriterXML.h"
 #include <mitkIGTMimeTypes.h>
 #include <mitkLocaleSwitch.h>
 #include <mitkUSDevice.h>
 
 // Third Party
-#include <tinyxml.h>
+#include <tinyxml2.h>
 #include <itksys/SystemTools.hxx>
 #include <fstream>
 #include <iostream>
 
 mitk::USDeviceWriterXML::USDeviceWriterXML() : AbstractFileWriter(USDevice::GetStaticNameOfClass(),
   mitk::IGTMimeTypes::USDEVICEINFORMATIONXML_MIMETYPE(),
   "MITK USDevice Writer (XML)"), m_Filename("")
 {
   RegisterService();
 }
 
 mitk::USDeviceWriterXML::USDeviceWriterXML(const mitk::USDeviceWriterXML& other) : AbstractFileWriter(other)
 {
 }
 
 mitk::USDeviceWriterXML::~USDeviceWriterXML()
 {
 }
 
 mitk::USDeviceWriterXML* mitk::USDeviceWriterXML::Clone() const
 {
   return new USDeviceWriterXML(*this);
 }
 
 void mitk::USDeviceWriterXML::Write()
 {
   if (m_Filename == "")
   {
     MITK_WARN << "Cannot write to file - empty filename!";
     return;
   }
 }
 
 void mitk::USDeviceWriterXML::SetFilename(std::string filename)
 {
   m_Filename = filename;
 }
 
 bool mitk::USDeviceWriterXML::WriteUltrasoundDeviceConfiguration(mitk::USDeviceReaderXML::USDeviceConfigData & config)
 {
-  TiXmlDocument document;
-  TiXmlDeclaration* xmlDeclaration = new TiXmlDeclaration("1.0", "", "");
-  document.LinkEndChild(xmlDeclaration);
-
+  tinyxml2::XMLDocument document;
+  document.InsertEndChild(document.NewDeclaration());
 
   //Create the xml information of the ULTRASOUNDDEVICE-Tag:
-  TiXmlElement *ultrasoundDeviceTag = new TiXmlElement(TAG_ULTRASOUNDDEVICE);
+  auto *ultrasoundDeviceTag = document.NewElement(USDeviceReaderWriterConstants::TAG_ULTRASOUNDDEVICE);
   this->CreateXmlInformationOfUltrasoundDeviceTag(document, ultrasoundDeviceTag, config);
 
 
   //Create the xml information of the GENERALSETTINGS-Tag:
-  TiXmlElement *generalSettingsTag = new TiXmlElement(TAG_GENERALSETTINGS);
+  auto *generalSettingsTag = document.NewElement(USDeviceReaderWriterConstants::TAG_GENERALSETTINGS);
   this->CreateXmlInformationOfGeneralSettingsTag(ultrasoundDeviceTag, generalSettingsTag, config);
 
   //Create the xml information of the PROBES-Tag:
   this->CreateXmlInformationOfProbesTag(ultrasoundDeviceTag, config);
 
-  return document.SaveFile(m_Filename);
+  return document.SaveFile(m_Filename.c_str()) == tinyxml2::XML_SUCCESS;
 }
 
 void mitk::USDeviceWriterXML::CreateXmlInformationOfUltrasoundDeviceTag(
-  TiXmlDocument &document, TiXmlElement * ultrasoundDeviceTag,
+  tinyxml2::XMLDocument &document, tinyxml2::XMLElement* ultrasoundDeviceTag,
   mitk::USDeviceReaderXML::USDeviceConfigData &config)
 {
-  ultrasoundDeviceTag->SetAttribute(ATTR_FILEVERS, config.fileversion);
-  ultrasoundDeviceTag->SetAttribute(ATTR_TYPE, config.deviceType);
-  ultrasoundDeviceTag->SetAttribute(ATTR_NAME, config.deviceName);
-  ultrasoundDeviceTag->SetAttribute(ATTR_MANUFACTURER, config.manufacturer);
-  ultrasoundDeviceTag->SetAttribute(ATTR_MODEL, config.model);
-  ultrasoundDeviceTag->SetAttribute(ATTR_COMMENT, config.comment);
-  ultrasoundDeviceTag->SetAttribute(ATTR_IMAGESTREAMS, config.numberOfImageStreams);
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_FILEVERS, config.fileversion);
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_TYPE, config.deviceType.c_str());
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_NAME, config.deviceName.c_str());
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_MANUFACTURER, config.manufacturer.c_str());
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_MODEL, config.model.c_str());
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_COMMENT, config.comment.c_str());
+  ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_IMAGESTREAMS, config.numberOfImageStreams);
 
   if (config.deviceType.compare("oigtl") == 0)
   {
-    ultrasoundDeviceTag->SetAttribute(ATTR_HOST, config.host);
-    ultrasoundDeviceTag->SetAttribute(ATTR_PORT, config.port);
-    std::string value = config.server ? "true" : "false";
-    ultrasoundDeviceTag->SetAttribute(ATTR_SERVER, value);
+    ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_HOST, config.host.c_str());
+    ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_PORT, config.port);
+    ultrasoundDeviceTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_SERVER, config.server);
   }
 
-  document.LinkEndChild(ultrasoundDeviceTag);
+  document.InsertEndChild(ultrasoundDeviceTag);
 }
 
-void mitk::USDeviceWriterXML::CreateXmlInformationOfGeneralSettingsTag(TiXmlElement *parentTag, TiXmlElement *generalSettingsTag, mitk::USDeviceReaderXML::USDeviceConfigData & config)
+void mitk::USDeviceWriterXML::CreateXmlInformationOfGeneralSettingsTag(tinyxml2::XMLElement *parentTag, tinyxml2::XMLElement *generalSettingsTag, mitk::USDeviceReaderXML::USDeviceConfigData & config)
 {
-  std::string value = config.useGreyscale ? "true" : "false";
-  generalSettingsTag->SetAttribute(ATTR_GREYSCALE, value);
-  value = config.useResolutionOverride ? "true" : "false";
-  generalSettingsTag->SetAttribute(ATTR_RESOLUTIONOVERRIDE, value);
-  generalSettingsTag->SetAttribute(ATTR_RESOLUTIONWIDTH, config.resolutionWidth);
-  generalSettingsTag->SetAttribute(ATTR_RESOLUTIONHEIGHT, config.resolutionHeight);
-
-  generalSettingsTag->SetAttribute(ATTR_SOURCEID, config.sourceID);
-  generalSettingsTag->SetAttribute(ATTR_FILEPATH, config.filepathVideoSource);
-  generalSettingsTag->SetAttribute(ATTR_OPENCVPORT, config.opencvPort);
-
-  parentTag->LinkEndChild(generalSettingsTag);
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_GREYSCALE, config.useGreyscale);
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONOVERRIDE, config.useResolutionOverride);
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONWIDTH, config.resolutionWidth);
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_RESOLUTIONHEIGHT, config.resolutionHeight);
+
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_SOURCEID, config.sourceID);
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_FILEPATH, config.filepathVideoSource.c_str());
+  generalSettingsTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_OPENCVPORT, config.opencvPort);
+
+  parentTag->InsertEndChild(generalSettingsTag);
 }
 
-void mitk::USDeviceWriterXML::CreateXmlInformationOfProbesTag(TiXmlElement * parentTag, mitk::USDeviceReaderXML::USDeviceConfigData & config)
+void mitk::USDeviceWriterXML::CreateXmlInformationOfProbesTag(tinyxml2::XMLElement *parentTag, mitk::USDeviceReaderXML::USDeviceConfigData & config)
 {
   if (config.probes.size() != 0)
   {
-    TiXmlElement *probesTag = new TiXmlElement(TAG_PROBES);
-    parentTag->LinkEndChild(probesTag);
+    auto* doc = parentTag->GetDocument();
+    auto *probesTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_PROBES);
+    parentTag->InsertEndChild(probesTag);
 
     for (size_t index = 0; index < config.probes.size(); ++index)
     {
-      TiXmlElement *probeTag = new TiXmlElement(TAG_PROBE);
-      probesTag->LinkEndChild(probeTag);
+      auto *probeTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_PROBE);
+      probesTag->InsertEndChild(probeTag);
 
       mitk::USProbe::Pointer probe = config.probes.at(index);
-      probeTag->SetAttribute(ATTR_NAME, probe->GetName());
+      probeTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_NAME, probe->GetName().c_str());
       std::map<int, mitk::Vector3D> depthsAndSpacing = probe->GetDepthsAndSpacing();
       if (depthsAndSpacing.size() != 0)
       {
-        TiXmlElement *depthsTag = new TiXmlElement(TAG_DEPTHS);
-        probeTag->LinkEndChild(depthsTag);
+        auto *depthsTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_DEPTHS);
+        probeTag->InsertEndChild(depthsTag);
         for (std::map<int, mitk::Vector3D>::iterator it = depthsAndSpacing.begin(); it != depthsAndSpacing.end(); it++)
         {
-          TiXmlElement *depthTag = new TiXmlElement(TAG_DEPTH);
-          depthTag->SetAttribute(ATTR_DEPTH, it->first);
-          depthsTag->LinkEndChild(depthTag);
-
-          TiXmlElement *spacingTag = new TiXmlElement(TAG_SPACING);
-          spacingTag->SetDoubleAttribute(ATTR_X, it->second[0], 6);
-          spacingTag->SetDoubleAttribute(ATTR_Y, it->second[1], 6);
-          depthTag->LinkEndChild(spacingTag);
+          auto *depthTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_DEPTH);
+          depthTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_DEPTH, it->first);
+          depthsTag->InsertEndChild(depthTag);
+
+          auto *spacingTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_SPACING);
+          spacingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_X, it->second[0]);
+          spacingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_Y, it->second[1]);
+          depthTag->InsertEndChild(spacingTag);
         }
 
-        TiXmlElement *croppingTag = new TiXmlElement(TAG_CROPPING);
-        probeTag->LinkEndChild(croppingTag);
-        croppingTag->SetAttribute(ATTR_TOP, probe->GetProbeCropping().top);
-        croppingTag->SetAttribute(ATTR_BOTTOM, probe->GetProbeCropping().bottom);
-        croppingTag->SetAttribute(ATTR_LEFT, probe->GetProbeCropping().left);
-        croppingTag->SetAttribute(ATTR_RIGHT, probe->GetProbeCropping().right);
+        auto *croppingTag = doc->NewElement(USDeviceReaderWriterConstants::TAG_CROPPING);
+        probeTag->InsertEndChild(croppingTag);
+        croppingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_TOP, probe->GetProbeCropping().top);
+        croppingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_BOTTOM, probe->GetProbeCropping().bottom);
+        croppingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_LEFT, probe->GetProbeCropping().left);
+        croppingTag->SetAttribute(USDeviceReaderWriterConstants::ATTR_RIGHT, probe->GetProbeCropping().right);
       }
     }
   }
 }
diff --git a/Modules/US/USModel/mitkUSDeviceWriterXML.h b/Modules/US/USModel/mitkUSDeviceWriterXML.h
index 657f07d25c..1177b144e3 100644
--- a/Modules/US/USModel/mitkUSDeviceWriterXML.h
+++ b/Modules/US/USModel/mitkUSDeviceWriterXML.h
@@ -1,88 +1,91 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #ifndef mitkUSDeviceWriterXML_H_Header_INCLUDED_
 #define mitkUSDeviceWriterXML_H_Header_INCLUDED_
 
 #include <MitkUSExports.h>
 
 #include <mitkAbstractFileWriter.h>
 #include <mitkUSDeviceReaderXML.h>
 
-class TiXmlDocument;
-class TiXmlElement;
+namespace tinyxml2
+{
+  class XMLDocument;
+  class XMLElement;
+}
 
 namespace mitk {
   class MITKUS_EXPORT USDeviceWriterXML : public AbstractFileWriter
   {
   public:
 
     USDeviceWriterXML();
     ~USDeviceWriterXML() override;
 
     using AbstractFileWriter::Write;
     void Write() override;
 
     /**
     * \brief Sets the filename of the ultrasound device configuration file which should be created.
     */
     void SetFilename(std::string filename);
 
     /**
     * \brief Writes the configuration settings of an ultrasound device to a xml-file.
     * \param config The struct containing all information of the ultrasound device.
     */
     bool WriteUltrasoundDeviceConfiguration(mitk::USDeviceReaderXML::USDeviceConfigData &config);
 
   protected:
     USDeviceWriterXML(const USDeviceWriterXML& other);
     mitk::USDeviceWriterXML* Clone() const override;
 
     /**
     * \brief Creates the xml ULTRASOUNDDEVICE-Tag entry of the ultrasound video device configuration file.
     * \param document A reference to the xml document.
     * \param ultrasoundDeviceTag The ULTRASOUNDDEVICETAG which should be created.
     * \param config The struct containing all information of the ultrasound device.
     */
-    void CreateXmlInformationOfUltrasoundDeviceTag( TiXmlDocument &document,
-                                                    TiXmlElement *ultrasoundDeviceTag,
+    void CreateXmlInformationOfUltrasoundDeviceTag( tinyxml2::XMLDocument &document,
+                                                    tinyxml2::XMLElement *ultrasoundDeviceTag,
                                                     mitk::USDeviceReaderXML::USDeviceConfigData &config);
 
     /**
     * \brief Creates the xml GENERALSETTINGS-Tag entry of the ultrasound video device configuration file.
     * \param parentTag The xml parent tag of the GENERALSETTINGS-Tag. This is the ULTRASOUNDDEVICE-Tag.
     * \param generalSettingsTag The GENERALSETTINGS-Tag which should be created.
     * \param config The struct containing all information of the ultrasound device.
     */
-    void CreateXmlInformationOfGeneralSettingsTag( TiXmlElement *parentTag,
-                                                   TiXmlElement *generalSettingsTag,
+    void CreateXmlInformationOfGeneralSettingsTag( tinyxml2::XMLElement *parentTag,
+                                                   tinyxml2::XMLElement *generalSettingsTag,
                                                    mitk::USDeviceReaderXML::USDeviceConfigData &config);
 
     /**
     * \brief Creates the xml PROBES-Tag entry of the ultrasound video device configuration file. All information
     * of all configured probes is extracted and then stored in the xml file.
     * \param parentTag The xml parent tag of the GENERALSETTINGS-Tag. This is the ULTRASOUNDDEVICE-Tag.
     * \param config The struct containing all information of the ultrasound device.
     */
-    void CreateXmlInformationOfProbesTag( TiXmlElement *parentTag,
+    void CreateXmlInformationOfProbesTag( tinyxml2::XMLElement*parentTag,
                                           mitk::USDeviceReaderXML::USDeviceConfigData &config);
   private:
     /**
     * \brief The filename of the ultrasound device configuration file which should be created.
     */
     std::string m_Filename;
 
 
   };
 }
 
 #endif // mitkUSDeviceWriterXML_H_Header_INCLUDED_
diff --git a/Modules/US/USNavigation/Testing/mitkCombinedModalityTest.cpp b/Modules/US/USNavigation/Testing/mitkCombinedModalityTest.cpp
index e12ebc1b21..87465cbbd8 100644
--- a/Modules/US/USNavigation/Testing/mitkCombinedModalityTest.cpp
+++ b/Modules/US/USNavigation/Testing/mitkCombinedModalityTest.cpp
@@ -1,176 +1,171 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkUSCombinedModality.h"
 #include <mitkVirtualTrackingDevice.h>
 #include <mitkUSVideoDevice.h>
 #include <mitkTestingMacros.h>
 #include <mitkTrackingDeviceSource.h>
 
 class mitkCombinedModalityTestClass
 {
 public:
 
-  /*
-  * \brief Returns a reference string for serialized calibrations.
-  */
-
-  static std::string GetSerializedReference()
-  {
-
-    return std::string("<calibrations>\n<") + mitk::USCombinedModality::DefaultProbeIdentifier + mitk::USCombinedModality::ProbeAndDepthSeperator
-                       + "0 M00=\"1.1234\" M01=\"1.2234\" M02=\"1.3234\" M10=\"1.4234\" M11=\"1.5234\" M12=\"1.6234\" M20=\"1.7234\" M21=\"1.8234\" M22=\"1.9234\" T0=\"2.1234\" T1=\"2.2234\" T2=\"2.3234\" />\n</calibrations>\n";
-  }
-
   static bool CompareDoubles (double A, double B)
   {
-    float diff = A - B;
-    return (diff < 0.0001) && (-diff < 0.0001);
+    return std::abs(A - B) < 0.0001;
   }
 
   /*
   * \brief Creates a dummy combined modality.
   */
   static mitk::USCombinedModality::Pointer CreateModality()
   {
     mitk::USVideoDevice::Pointer  usDevice =  mitk::USVideoDevice::New("IllegalPath", "Manufacturer", "Model");
     mitk::VirtualTrackingDevice::Pointer tracker = mitk::VirtualTrackingDevice::New();
     tracker->AddTool("tool1");
     tracker->AddTool("tool2");
     mitk::TrackingDeviceSource::Pointer source = mitk::TrackingDeviceSource::New();
     source->SetTrackingDevice(tracker);
     source->Connect();
     source->StartTracking();
     return mitk::USCombinedModality::New(usDevice.GetPointer(), source.GetPointer(), false);
   }
 
   static void TestInstantiation()
   {
     mitk::USCombinedModality::Pointer combinedModality = CreateModality();
     MITK_TEST_CONDITION_REQUIRED(combinedModality.IsNotNull(), "CombinedModality should not be null after instantiation");
   }
 
   static void TestSerialization()
   {
-    mitk::USCombinedModality::Pointer modality = CreateModality();
+    auto modality = CreateModality();
 
     mitk::AffineTransform3D::MatrixType matrix;
     matrix[0][0] = 1.1234;
     matrix[0][1] = 1.2234;
     matrix[0][2] = 1.3234;
     matrix[1][0] = 1.4234;
     matrix[1][1] = 1.5234;
     matrix[1][2] = 1.6234;
     matrix[2][0] = 1.7234;
     matrix[2][1] = 1.8234;
     matrix[2][2] = 1.9234;
 
     mitk::AffineTransform3D::OffsetType offset;
     offset[0] = 2.1234;
     offset[1] = 2.2234;
     offset[2] = 2.3234;
 
     mitk::AffineTransform3D::Pointer transform = mitk::AffineTransform3D::New();
     transform->SetMatrix(matrix);
     transform->SetOffset(offset);
 
     modality->SetCalibration(transform);
 
-    MITK_TEST_CONDITION_REQUIRED(modality->SerializeCalibration() == GetSerializedReference(), "Testing correct Serialization...");
-  }
-
-  static void TestDeserialization()
-  {
-    mitk::USCombinedModality::Pointer modality = CreateModality();
-    modality->DeserializeCalibration(GetSerializedReference());
-    mitk::AffineTransform3D::Pointer transform = modality->GetCalibration();
-
-    mitk::AffineTransform3D::MatrixType matrix = transform->GetMatrix();
-    mitk::AffineTransform3D::OffsetType offset = transform->GetOffset();;
+    const auto xmlString = modality->SerializeCalibration();
+    auto otherModality = CreateModality();
+    otherModality->DeserializeCalibration(xmlString);
+    auto calibration = otherModality->GetCalibration();
+    const auto& otherMatrix = calibration->GetMatrix();
+    const auto& otherOffset = calibration->GetOffset();
 
     bool identical = true;
 
-    if (! CompareDoubles(matrix[0][0], 1.1234)) identical = false;
-    if (! CompareDoubles(matrix[0][1], 1.2234)) identical = false;
-    if (! CompareDoubles(matrix[0][2], 1.3234)) identical = false;
-    if (! CompareDoubles(matrix[1][0], 1.4234)) identical = false;
-    if (! CompareDoubles(matrix[1][1], 1.5234)) identical = false;
-    if (! CompareDoubles(matrix[1][2], 1.6234)) identical = false;
-    if (! CompareDoubles(matrix[2][0], 1.7234)) identical = false;
-    if (! CompareDoubles(matrix[2][1], 1.8234)) identical = false;
-    if (! CompareDoubles(matrix[2][2], 1.9234)) identical = false;
-
-    if (! CompareDoubles(offset[0], 2.1234)) identical = false;
-    if (! CompareDoubles(offset[1], 2.2234)) identical = false;
-    if (! CompareDoubles(offset[2], 2.3234)) identical = false;
+    for (size_t i = 0; i < 3; ++i)
+    {
+      for (size_t j = 0; j < 3; ++j)
+      {
+        if (!CompareDoubles(matrix[i][j], otherMatrix[i][j]))
+        {
+          identical = false;
+          break;
+        }
+      }
+
+      if (!identical)
+        break;
+    }
+
+    if (identical)
+    {
+      for (size_t i = 0; i < 3; ++i)
+      {
+        if (!CompareDoubles(offset[i], otherOffset[i]))
+        {
+          identical = false;
+          break;
+        }
+      }
+    }
 
     MITK_TEST_CONDITION_REQUIRED(identical, "Testing if deserialized calibration is identical to serialized one...");
 
     // test if invalid strings cause exceptions
     MITK_TEST_FOR_EXCEPTION(mitk::Exception, modality->DeserializeCalibration("invalid-string"));
     MITK_TEST_FOR_EXCEPTION(mitk::Exception, modality->DeserializeCalibration("<xml><test></xml>", false));
   }
 
   static void TestFilterPipeline()
   {
     /*mitk::USCombinedModality::Pointer combinedModality = mitkCombinedModalityTestClass::CreateModality();
     MITK_INFO << combinedModality->GetNavigationDataSource()->GetNameOfClass();
     MITK_TEST_CONDITION(strcmp(combinedModality->GetNavigationDataSource()->GetNameOfClass(), "TrackingDeviceSource") == 0,
                         "")*/
 
     mitk::USVideoDevice::Pointer  usDevice =  mitk::USVideoDevice::New("IllegalPath", "Manufacturer", "Model");
     mitk::VirtualTrackingDevice::Pointer tracker = mitk::VirtualTrackingDevice::New();
     tracker->AddTool("tool1");
     tracker->AddTool("tool2");
     mitk::TrackingDeviceSource::Pointer source = mitk::TrackingDeviceSource::New();
     source->SetTrackingDevice(tracker);
     source->Connect();
     source->StartTracking();
     mitk::USCombinedModality::Pointer modality = mitk::USCombinedModality::New(usDevice.GetPointer(), source.GetPointer(), false);
 
     MITK_TEST_CONDITION(source->GetOutput(0) == modality->GetNavigationDataSource()->GetOutput(0),
                         "Navigation data output of the Combined Modality should be the same as the source output as no filters are active.")
 
     modality->SetNumberOfSmoothingValues(2);
 
     mitk::NavigationDataSource::Pointer smoothingFilter = modality->GetNavigationDataSource();
     MITK_TEST_CONDITION(source->GetOutput(0) != smoothingFilter->GetOutput(0),
                         "Navigation data output of the Combined Modality should be different to the source output as smoothing filter is active.")
 
     modality->SetNumberOfSmoothingValues(0);
     MITK_TEST_CONDITION(source->GetOutput(0) == modality->GetNavigationDataSource()->GetOutput(0),
                         "Navigation data output of the Combined Modality should be the same as the source output again.")
 
     modality->SetDelayCount(5);
     MITK_TEST_CONDITION(source->GetOutput(0) != smoothingFilter->GetOutput(0),
                         "Navigation data output of the Combined Modality should be different to the source output as delay filter is active.")
 
     modality->SetDelayCount(0);
     MITK_TEST_CONDITION(source->GetOutput(0) == modality->GetNavigationDataSource()->GetOutput(0),
                         "Navigation data output of the Combined Modality should be the same as the source output again.")
   }
 };
 
 /**
 * This function is testing methods of the class USDevice.
 */
 int mitkCombinedModalityTest(int /* argc */, char* /*argv*/[])
 {
   MITK_TEST_BEGIN("mitkCombinedModalityTest");
 
   mitkCombinedModalityTestClass::TestInstantiation();
   mitkCombinedModalityTestClass::TestSerialization();
-  mitkCombinedModalityTestClass::TestDeserialization();
   mitkCombinedModalityTestClass::TestFilterPipeline();
 
   MITK_TEST_END();
 }
diff --git a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.cpp b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.cpp
index 7c64a04970..0f9e821238 100644
--- a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.cpp
+++ b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.cpp
@@ -1,491 +1,495 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "mitkAbstractUltrasoundTrackerDevice.h"
 #include "mitkImageReadAccessor.h"
 #include "mitkNavigationDataDelayFilter.h"
 #include "mitkNavigationDataDisplacementFilter.h"
 #include "mitkNavigationDataSmoothingFilter.h"
 #include "mitkTrackingDeviceSource.h"
 
 // US Control Interfaces
 #include "mitkUSControlInterfaceBMode.h"
 #include "mitkUSControlInterfaceDoppler.h"
 #include "mitkUSControlInterfaceProbes.h"
 
 // Microservices
 #include <usGetModuleContext.h>
 #include <usModule.h>
 #include <usModuleContext.h>
 #include <usServiceProperties.h>
 
 #include <algorithm>
 
 // TempIncludes
-#include <tinyxml.h>
+#include <tinyxml2.h>
 
 const std::string mitk::AbstractUltrasoundTrackerDevice::DeviceClassIdentifier =
   "org.mitk.modules.us.AbstractUltrasoundTrackerDevice";
 const char *mitk::AbstractUltrasoundTrackerDevice::DefaultProbeIdentifier = "default";
 const char *mitk::AbstractUltrasoundTrackerDevice::ProbeAndDepthSeperator = "_";
 
 const std::string mitk::AbstractUltrasoundTrackerDevice::US_INTERFACE_NAME =
   "org.mitk.services.AbstractUltrasoundTrackerDevice";
 const std::string mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_DEVICENAME = US_INTERFACE_NAME + ".devicename";
 const std::string mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_CLASS = US_INTERFACE_NAME + ".class";
 const std::string mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_ID = US_INTERFACE_NAME + ".id";
 //____
 
 mitk::AbstractUltrasoundTrackerDevice::AbstractUltrasoundTrackerDevice(USDevice::Pointer usDevice,
                                                                        NavigationDataSource::Pointer trackingDevice,
                                                                        bool trackedUltrasoundActive)
   : m_UltrasoundDevice(usDevice),
     m_TrackingDeviceDataSource(trackingDevice),
     m_SmoothingFilter(mitk::NavigationDataSmoothingFilter::New()),
     m_DelayFilter(mitk::NavigationDataDelayFilter::New(0)),
     m_DisplacementFilter(mitk::NavigationDataDisplacementFilter::New()),
     m_LastFilterOfIGTPipeline(nullptr),
     m_NumberOfSmoothingValues(0),
     m_DelayCount(0),
     m_IsTrackedUltrasoundActive(trackedUltrasoundActive)
 {
   m_DisplacementFilter->SetTransform6DOF(true);
 
   this->RebuildFilterPipeline();
 
   // create a new output (for the image data)
   //___ mitk::Image::Pointer newOutput = mitk::Image::New();
   //___ this->SetNthOutput(0, newOutput);
 
   // Combined Modality should not spawn an own acquire thread, because
   // image acquiring is done by the included us device
   //___ m_UltrasoundDevice->SetSpawnAcquireThread(false);
 }
 
 mitk::AffineTransform3D::Pointer mitk::AbstractUltrasoundTrackerDevice::GetUSPlaneTransform()
 {
   return mitk::AffineTransform3D::New();
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::SetIsFreezed(bool freeze)
 {
   if (m_UltrasoundDevice.IsNull() || m_TrackingDeviceDataSource.IsNull())
   {
     MITK_WARN << "Combined modality not correctly initialized, aborting!";
     return;
   }
 
   if (!m_UltrasoundDevice->GetIsActive())
   {
     MITK_WARN("mitkUSDevice")
       << "Cannot freeze or unfreeze if device is not active.";
     return;
   }
 
   this->OnFreeze(freeze);
 
   if (freeze)
   {
     m_IsFreezed = true;
   }
   else
   {
     m_IsFreezed = false;
   }
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::GetIsFreezed()
 {
   return m_IsFreezed;
 }
 
 mitk::AbstractUltrasoundTrackerDevice::~AbstractUltrasoundTrackerDevice()
 {
   if (m_ServiceRegistration != nullptr)
   {
     m_ServiceRegistration.Unregister();
   }
   m_ServiceRegistration = 0;
 }
 
 mitk::AffineTransform3D::Pointer mitk::AbstractUltrasoundTrackerDevice::GetCalibration()
 {
   return this->GetCalibration(this->GetCurrentDepthValue(), this->GetIdentifierForCurrentProbe());
 }
 
 mitk::AffineTransform3D::Pointer mitk::AbstractUltrasoundTrackerDevice::GetCalibration(std::string depth)
 {
   return this->GetCalibration(depth, this->GetIdentifierForCurrentProbe());
 }
 
 mitk::AffineTransform3D::Pointer mitk::AbstractUltrasoundTrackerDevice::GetCalibration(std::string depth,
                                                                                        std::string probe)
 {
   // make sure that there is no '/' which would cause problems for TinyXML
   std::replace(probe.begin(), probe.end(), '/', '-');
 
   // create identifier for calibration from probe and depth
   std::string calibrationKey = probe + mitk::AbstractUltrasoundTrackerDevice::ProbeAndDepthSeperator + depth;
 
   // find calibration for combination of probe identifier and depth
   std::map<std::string, mitk::AffineTransform3D::Pointer>::iterator calibrationIterator =
     m_Calibrations.find(calibrationKey);
 
   if (calibrationIterator == m_Calibrations.end())
   {
     return nullptr;
   }
 
   return calibrationIterator->second;
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::SetCalibration(mitk::AffineTransform3D::Pointer calibration)
 {
   if (calibration.IsNull())
   {
     MITK_WARN << "Null pointer passed to SetCalibration of mitk::USDevice. Ignoring call.";
     return;
   }
 
   std::string calibrationKey = this->GetIdentifierForCurrentCalibration();
   if (calibrationKey.empty())
   {
     MITK_WARN << "Could not get a key for the calibration -> Calibration cannot be set.";
     return;
   }
 
   m_Calibrations[calibrationKey] = calibration;
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::RemoveCalibration()
 {
   return this->RemoveCalibration(this->GetCurrentDepthValue(), this->GetIdentifierForCurrentProbe());
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::RemoveCalibration(std::string depth)
 {
   return this->RemoveCalibration(depth, this->GetIdentifierForCurrentProbe());
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::RemoveCalibration(std::string depth, std::string probe)
 {
   // make sure that there is no '/' which would cause problems for TinyXML
   std::replace(probe.begin(), probe.end(), '/', '-');
 
   // create identifier for calibration from probe and depth
   std::string calibrationKey = probe + mitk::AbstractUltrasoundTrackerDevice::ProbeAndDepthSeperator + depth;
 
   return m_Calibrations.erase(calibrationKey) > 0;
 }
 
 std::string mitk::AbstractUltrasoundTrackerDevice::GetDeviceClass()
 {
   return DeviceClassIdentifier;
 }
 
 mitk::USImageSource::Pointer mitk::AbstractUltrasoundTrackerDevice::GetUSImageSource()
 {
   if (m_UltrasoundDevice.IsNull())
   {
     MITK_ERROR("AbstractUltrasoundTrackerDevice")("USDevice") << "UltrasoundDevice must not be null.";
     mitkThrow() << "UltrasoundDevice must not be null.";
   }
 
   return m_UltrasoundDevice->GetUSImageSource();
 }
 
 mitk::NavigationDataSource::Pointer mitk::AbstractUltrasoundTrackerDevice::GetNavigationDataSource()
 {
   if (m_LastFilterOfIGTPipeline.IsNull())
   {
     this->RebuildFilterPipeline();
   }
   m_LastFilterOfIGTPipeline->SetToolMetaDataCollection(this->m_TrackingDeviceDataSource->GetToolMetaDataCollection());
   return m_LastFilterOfIGTPipeline;
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::GetIsCalibratedForCurrentStatus()
 {
   return m_Calibrations.find(this->GetIdentifierForCurrentCalibration()) != m_Calibrations.end();
 }
 
 bool mitk::AbstractUltrasoundTrackerDevice::GetContainsAtLeastOneCalibration()
 {
   return !m_Calibrations.empty();
 }
 
 std::string mitk::AbstractUltrasoundTrackerDevice::SerializeCalibration()
 {
-  std::stringstream result;
-  result << "<calibrations>" << std::endl;
+  tinyxml2::XMLDocument doc;
+  auto* calibrations = doc.NewElement("calibrations");
+  doc.InsertEndChild(calibrations);
+
   // For each calibration in the set
   for (std::map<std::string, mitk::AffineTransform3D::Pointer>::iterator it = m_Calibrations.begin();
        it != m_Calibrations.end();
        it++)
   {
     mitk::AffineTransform3D::MatrixType matrix = it->second->GetMatrix();
     mitk::AffineTransform3D::TranslationType translation = it->second->GetTranslation();
-    TiXmlElement elem(it->first);
+    auto *elem = doc.NewElement(it->first.c_str());
     // Serialize Matrix
-    elem.SetDoubleAttribute("M00", matrix[0][0]);
-    elem.SetDoubleAttribute("M01", matrix[0][1]);
-    elem.SetDoubleAttribute("M02", matrix[0][2]);
-    elem.SetDoubleAttribute("M10", matrix[1][0]);
-    elem.SetDoubleAttribute("M11", matrix[1][1]);
-    elem.SetDoubleAttribute("M12", matrix[1][2]);
-    elem.SetDoubleAttribute("M20", matrix[2][0]);
-    elem.SetDoubleAttribute("M21", matrix[2][1]);
-    elem.SetDoubleAttribute("M22", matrix[2][2]);
+    elem->SetAttribute("M00", matrix[0][0]);
+    elem->SetAttribute("M01", matrix[0][1]);
+    elem->SetAttribute("M02", matrix[0][2]);
+    elem->SetAttribute("M10", matrix[1][0]);
+    elem->SetAttribute("M11", matrix[1][1]);
+    elem->SetAttribute("M12", matrix[1][2]);
+    elem->SetAttribute("M20", matrix[2][0]);
+    elem->SetAttribute("M21", matrix[2][1]);
+    elem->SetAttribute("M22", matrix[2][2]);
     // Serialize Offset
-    elem.SetDoubleAttribute("T0", translation[0]);
-    elem.SetDoubleAttribute("T1", translation[1]);
-    elem.SetDoubleAttribute("T2", translation[2]);
+    elem->SetAttribute("T0", translation[0]);
+    elem->SetAttribute("T1", translation[1]);
+    elem->SetAttribute("T2", translation[2]);
 
-    result << elem << std::endl;
+    calibrations->InsertEndChild(elem);
   }
-  result << "</calibrations>" << std::endl;
 
-  return result.str();
+  tinyxml2::XMLPrinter printer;
+  doc.Print(&printer);
+
+  return printer.CStr();
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::DeserializeCalibration(const std::string &xmlString,
                                                                    bool clearPreviousCalibrations)
 {
   // Sanitize Input
   if (xmlString == "")
   {
     MITK_ERROR << "Empty string passed to Deserialize() method of CombinedModality. Aborting...";
     mitkThrow() << "Empty string passed to Deserialize() method of CombinedModality. Aborting...";
     return;
   }
   // Clear previous calibrations if necessary
   if (clearPreviousCalibrations)
     m_Calibrations.clear();
 
   // Parse Input
-  TiXmlDocument doc;
-  if (!doc.Parse(xmlString.c_str()))
+  tinyxml2::XMLDocument doc;
+  if (tinyxml2::XML_SUCCESS != doc.Parse(xmlString.c_str()))
   {
-    MITK_ERROR << "Unable to deserialize calibrations in CombinedModality. Error was: " << doc.ErrorDesc();
-    mitkThrow() << "Unable to deserialize calibrations in CombinedModality. Error was: " << doc.ErrorDesc();
+    MITK_ERROR << "Unable to deserialize calibrations in CombinedModality. Error was: " << doc.ErrorStr();
+    mitkThrow() << "Unable to deserialize calibrations in CombinedModality. Error was: " << doc.ErrorStr();
     return;
   }
-  TiXmlElement *root = doc.FirstChildElement();
+  auto *root = doc.FirstChildElement();
   if (root == nullptr)
   {
     MITK_ERROR << "Unable to deserialize calibrations in CombinedModality. String contained no root element.";
     mitkThrow() << "Unable to deserialize calibrations in CombinedModality. String contained no root element.";
     return;
   }
   // Read Calibrations
-  for (TiXmlElement *elem = root->FirstChildElement(); elem != nullptr; elem = elem->NextSiblingElement())
+  for (auto *elem = root->FirstChildElement(); elem != nullptr; elem = elem->NextSiblingElement())
   {
     mitk::AffineTransform3D::MatrixType matrix;
     mitk::AffineTransform3D::OffsetType translation;
 
     std::string calibName = elem->Value();
 
     // Deserialize Matrix
     elem->QueryDoubleAttribute("M00", &matrix[0][0]);
     elem->QueryDoubleAttribute("M01", &matrix[0][1]);
     elem->QueryDoubleAttribute("M02", &matrix[0][2]);
     elem->QueryDoubleAttribute("M10", &matrix[1][0]);
     elem->QueryDoubleAttribute("M11", &matrix[1][1]);
     elem->QueryDoubleAttribute("M12", &matrix[1][2]);
     elem->QueryDoubleAttribute("M20", &matrix[2][0]);
     elem->QueryDoubleAttribute("M21", &matrix[2][1]);
     elem->QueryDoubleAttribute("M22", &matrix[2][2]);
 
     // Deserialize Offset
     elem->QueryDoubleAttribute("T0", &translation[0]);
     elem->QueryDoubleAttribute("T1", &translation[1]);
     elem->QueryDoubleAttribute("T2", &translation[2]);
 
     mitk::AffineTransform3D::Pointer calibration = mitk::AffineTransform3D::New();
     calibration->SetMatrix(matrix);
     calibration->SetTranslation(translation);
     m_Calibrations[calibName] = calibration;
   }
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::SetNumberOfSmoothingValues(unsigned int numberOfSmoothingValues)
 {
   unsigned int oldNumber = m_NumberOfSmoothingValues;
   m_NumberOfSmoothingValues = numberOfSmoothingValues;
 
   // if filter should be activated or deactivated
   if ((oldNumber == 0 && numberOfSmoothingValues != 0) || (oldNumber != 0 && numberOfSmoothingValues == 0))
   {
     this->RebuildFilterPipeline();
   }
   m_SmoothingFilter->SetNumerOfValues(numberOfSmoothingValues);
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::SetDelayCount(unsigned int delayCount)
 {
   unsigned int oldCount = m_DelayCount;
   m_DelayCount = delayCount;
 
   // if filter should be activated or deactivated
   if ((oldCount == 0 && delayCount != 0) || (oldCount != 0 && delayCount == 0))
   {
     this->RebuildFilterPipeline();
   }
   m_DelayFilter->SetDelay(delayCount);
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::GenerateData() {}
 
 std::string mitk::AbstractUltrasoundTrackerDevice::GetIdentifierForCurrentCalibration()
 {
   return this->GetIdentifierForCurrentProbe() + mitk::AbstractUltrasoundTrackerDevice::ProbeAndDepthSeperator +
          this->GetCurrentDepthValue();
 }
 
 std::string mitk::AbstractUltrasoundTrackerDevice::GetIdentifierForCurrentProbe()
 {
   us::ServiceProperties usdeviceProperties = m_UltrasoundDevice->GetServiceProperties();
 
   us::ServiceProperties::const_iterator probeIt =
     usdeviceProperties.find(mitk::USDevice::GetPropertyKeys().US_PROPKEY_PROBES_SELECTED);
 
   // get probe identifier from control interface for probes
   std::string probeName = mitk::AbstractUltrasoundTrackerDevice::DefaultProbeIdentifier;
   if (probeIt != usdeviceProperties.end())
   {
     probeName = (probeIt->second).ToString();
   }
 
   // make sure that there is no '/' which would cause problems for TinyXML
   std::replace(probeName.begin(), probeName.end(), '/', '-');
 
   return probeName;
 }
 
 std::string mitk::AbstractUltrasoundTrackerDevice::GetCurrentDepthValue()
 {
   us::ServiceProperties usdeviceProperties = m_UltrasoundDevice->GetServiceProperties();
 
   // get string for depth value from the micro service properties
   std::string depth;
   us::ServiceProperties::iterator depthIterator =
     usdeviceProperties.find(mitk::USDevice::GetPropertyKeys().US_PROPKEY_BMODE_DEPTH);
 
   if (depthIterator != usdeviceProperties.end())
   {
     depth = depthIterator->second.ToString();
   }
   else
   {
     depth = "0";
   }
 
   return depth;
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::RebuildFilterPipeline()
 {
   m_LastFilterOfIGTPipeline = m_TrackingDeviceDataSource;
 
   if (m_NumberOfSmoothingValues > 0)
   {
     m_SmoothingFilter->ConnectTo(m_LastFilterOfIGTPipeline.GetPointer());
     m_LastFilterOfIGTPipeline = m_SmoothingFilter;
   }
 
   if (m_DelayCount > 0)
   {
     m_DelayFilter->ConnectTo(m_LastFilterOfIGTPipeline.GetPointer());
     m_LastFilterOfIGTPipeline = m_DelayFilter;
   }
 
   if (m_IsTrackedUltrasoundActive)
   {
     m_DisplacementFilter->ConnectTo(m_LastFilterOfIGTPipeline.GetPointer());
     m_LastFilterOfIGTPipeline = m_DisplacementFilter;
   }
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::UnregisterOnService()
 {
   if (m_UltrasoundDevice->GetDeviceState() == USDevice::State_Activated)
   {
     m_UltrasoundDevice->Deactivate();
   }
   if (m_UltrasoundDevice->GetDeviceState() == USDevice::State_Connected)
   {
     m_UltrasoundDevice->Disconnect();
   }
 
   if (m_ServiceRegistration != nullptr)
     m_ServiceRegistration.Unregister();
   m_ServiceRegistration = 0;
 }
 
 void mitk::AbstractUltrasoundTrackerDevice::RegisterAsMicroservice()
 {
   // Get Context
   us::ModuleContext *context = us::GetModuleContext();
 
   // Define ServiceProps
   // us::ServiceProperties props;
   mitk::UIDGenerator uidGen = mitk::UIDGenerator("org.mitk.services.AbstractUltrasoundTrackerDevice");
   m_ServiceProperties[US_PROPKEY_ID] = uidGen.GetUID();
   m_ServiceProperties[US_PROPKEY_DEVICENAME] = m_UltrasoundDevice->GetName();
   m_ServiceProperties[US_PROPKEY_CLASS] = mitk::AbstractUltrasoundTrackerDevice::DeviceClassIdentifier;
 
   m_ServiceRegistration = context->RegisterService(this, m_ServiceProperties);
 }
 
 mitk::USAbstractControlInterface::Pointer mitk::AbstractUltrasoundTrackerDevice::GetControlInterfaceCustom()
 {
   if (m_UltrasoundDevice.IsNull())
   {
     MITK_ERROR("USCombinedModality")("USDevice") << "UltrasoundDevice must not be null.";
     mitkThrow() << "UltrasoundDevice must not be null.";
   }
 
   return m_UltrasoundDevice->GetControlInterfaceCustom();
 }
 
 mitk::USControlInterfaceBMode::Pointer mitk::AbstractUltrasoundTrackerDevice::GetControlInterfaceBMode()
 {
   if (m_UltrasoundDevice.IsNull())
   {
     MITK_ERROR("USCombinedModality")("USDevice") << "UltrasoundDevice must not be null.";
     mitkThrow() << "UltrasoundDevice must not be null.";
   }
 
   return m_UltrasoundDevice->GetControlInterfaceBMode();
 }
 
 mitk::USControlInterfaceProbes::Pointer mitk::AbstractUltrasoundTrackerDevice::GetControlInterfaceProbes()
 {
   if (m_UltrasoundDevice.IsNull())
   {
     MITK_ERROR("USCombinedModality")("USDevice") << "UltrasoundDevice must not be null.";
     mitkThrow() << "UltrasoundDevice must not be null.";
   }
 
   return m_UltrasoundDevice->GetControlInterfaceProbes();
 }
 
 mitk::USControlInterfaceDoppler::Pointer mitk::AbstractUltrasoundTrackerDevice::GetControlInterfaceDoppler()
 {
   if (m_UltrasoundDevice.IsNull())
   {
     MITK_ERROR("USCombinedModality")("USDevice") << "UltrasoundDevice must not be null.";
     mitkThrow() << "UltrasoundDevice must not be null.";
   }
 
   return m_UltrasoundDevice->GetControlInterfaceDoppler();
 }
diff --git a/Modules/US/files.cmake b/Modules/US/files.cmake
index 42c099ed21..2f67fd9490 100644
--- a/Modules/US/files.cmake
+++ b/Modules/US/files.cmake
@@ -1,36 +1,37 @@
 SET(CPP_FILES
 
 ## Module Activator
 mitkUSActivator.cpp
 
 ## Model Classes
 USModel/mitkUSImage.cpp
 USModel/mitkUSImageMetadata.cpp
 USModel/mitkUSDevice.cpp
 USModel/mitkUSIGTLDevice.cpp
 USModel/mitkUSVideoDevice.cpp
 USModel/mitkUSVideoDeviceCustomControls.cpp
 USModel/mitkUSProbe.cpp
 USModel/mitkUSDevicePersistence.cpp
+USModel/mitkUSDeviceReaderWriterConstants.cpp
 USModel/mitkUSDeviceReaderXML.cpp
 USModel/mitkUSDeviceWriterXML.cpp
 
 ## Filters and Sources
 USFilters/mitkUSImageLoggingFilter.cpp
 USFilters/mitkUSImageSource.cpp
 USFilters/mitkUSImageVideoSource.cpp
 USFilters/mitkIGTLMessageToUSImageFilter.cpp
 
 ## Control Interfaces
 USControlInterfaces/mitkUSAbstractControlInterface.cpp
 USControlInterfaces/mitkUSControlInterfaceBMode.cpp
 USControlInterfaces/mitkUSControlInterfaceProbes.cpp
 USControlInterfaces/mitkUSControlInterfaceDoppler.cpp
 USControlInterfaces/mitkUSDiPhASDeviceCustomControls.cpp
 )
 
 set(RESOURCE_FILES
 Interactions/USPointMarkInteractions.xml
 Interactions/USZoneInteractions.xml
 Interactions/USZoneInteractionsHold.xml
 )
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
index d1f9457d9e..003b7c3787 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
@@ -1,150 +1,148 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 
 #ifndef MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_
 #define MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_
 
 #include <mitkNavigationDataPlayerBase.h>
-#include "tinyxml.h"
-
 
 namespace mitk
 {
 
   /**Documentation
   * \brief This class is a NavigationDataPlayer which can play CSV formatted
   * files in sequential order, which means it doesn't care about timestamps and just
   * outputs the navigationdatas in their sequential order.
   *
   * It is thought to interpret custom csv files. To do so please adapt the column
   * numbers of position and orientation in the internal method GetNavigationDataOutOfOneLine().
   *
   * So far only one (the first) tool is read in as required for the hummel protocol measurements.
   *
   * This class can also interpret MITK style csv files (set filetype to NavigationDataCSV), but
   * you can also use the MITK navigation data player class inside the MITK-IGT module which
   * is newer and better maintained.
   *
   * \ingroup IGT
   */
   class NavigationDataCSVSequentialPlayer
     : public NavigationDataPlayerBase
   {
   public:
 
     mitkClassMacro(NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase);
     itkNewMacro(Self);
 
     /**
     * \brief sets the file name and path (if XMLString is set, this is neglected)
     */
     void SetFileName(const std::string& _FileName);
 
     /**
      * @brief SetOptions    sets the options for reading out the data out of the correct postions of the file. They need to be set before using the player
      * @param rightHanded   true if the used coordinate System is right handed, false if it is left handed
      * @param seperatorSign symbol that is used to separate the values in the .csv file
      * @param sampleCount   every n-th sample in the file that should be used
      * @param headerRow     true if the .csv file has a header row otherwise false
      * @param xPos          number of the colum in the .csv file for the x-coordinates of the position
      * @param yPos          number of the colum in the .csv file for the y-coordinates of the position
      * @param zPos          number of the colum in the .csv file for the z-coordinates of the position
      * @param useQuats      true if Quaternions are used to construct the orientation, false if Euler Angles are used
      * @param qx            number of the column in the .csv file for the x component of the quaternion
      * @param qy            number of the column in the .csv file for the y component of the quaternion
      * @param qz            number of the column in the .csv file for the z component of the quaternion
      * @param qr            number of the column in the .csv file for the r component of the quaternion
      * @param azimuth       number of the colum in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined
      * @param elevatino     number of the colum in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined
      * @param roll          number of the colum in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined
      * @param eulerInRadiants   true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
      * @param minNumberOfColumns
      */
     void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats,
                     int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums);
 
     /**
     * \brief returns the file name and path
     */
     itkGetStringMacro(FileName);
 
     enum Filetype
     {
       NavigationDataCSV, //for csv files from the MITK navigation data player
       ManualLoggingCSV //for custum csv files
     };
     /**
     * \brief Sets the file type. ManualLoggingCSV is default and is thought for your
     *        custom csv files. You can also set it to NavigationDataCSV, then this
     *        player interprets MITK style csv files.
     */
     itkSetMacro(Filetype, Filetype);
 
     /**
     * \return Returns true if the player reached the end of the file.
     */
     bool IsAtEnd();
 
     /**
     * \brief Used for pipeline update just to tell the pipeline
     * that we always have to update
     */
     void UpdateOutputInformation() override;
 
     int GetNumberOfSnapshots();
 
   protected:
     NavigationDataCSVSequentialPlayer();
     ~NavigationDataCSVSequentialPlayer() override;
 
     ///
     /// do the work here
     ///
     void GenerateData() override;
 
     std::string m_FileName;
 
     int m_CurrentPos;
     Filetype m_Filetype;
 
     //member for the navigation datas which were read (only one output is supported at the moment)
     std::vector<mitk::NavigationData::Pointer> m_NavigationDatas;
 
     std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
     std::vector<std::string> GetFileContentLineByLine(std::string filename);
     mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
 
     void FillOutputEmpty(int number);
     mitk::NavigationData::Pointer GetEmptyNavigationData();
 
     bool m_RightHanded; //true if the used coordinate System is right handed, false if it is left handed
     char m_SeparatorSign; //symbol that is used to separate the values in the .csv file
     int m_SampleCount; //every n-th sample in the file that should be used
     bool m_HeaderRow; //true if the .csv file has a header row otherwise false
     int m_XPos; //number of the colum in the .csv file for the x-coordinates of the position
     int m_YPos; //number of the colum in the .csv file for the y-coordinates of the position
     int m_ZPos; //number of the colum in the .csv file for the z-coordinates of the position
     bool m_UseQuats; //true if Quaternions are used to construct the orientation, false if Euler Angles are used
     int m_Qx; //number of the column in the .csv file for the x component of the quaternion
     int m_Qy; //number of the column in the .csv file for the y component of the quaternion
     int m_Qz; //number of the column in the .csv file for the z component of the quaternion
     int m_Qr; //number of the column in the .csv file for the r component of the quaternion
     int m_Azimuth; //number of the colum in the .csv file for Azimuth (Euler Angles)
     int m_Elevation; //number of the colum in the .csv file for Elevation (Euler Angles)
     int m_Roll; //number of the colum in the .csv file for Roll (Euler Angles)
     bool m_EulersInRadiants; // true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
     int m_MinNumberOfColumns; //minimal number of columns the file has to have (e.g. if you read data from column 8 the file has to have at least 8 columns)
   };
 } // namespace mitk
 
 #endif /* MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_ */
diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.cpp b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.cpp
index b1d6ae2ba9..7af75c5031 100644
--- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.cpp
+++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.cpp
@@ -1,1104 +1,1102 @@
 /*============================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center (DKFZ)
 All rights reserved.
 
 Use of this source code is governed by a 3-clause BSD license that can be
 found in the LICENSE file.
 
 ============================================================================*/
 
 #include "QmitkMultiLabelSegmentationView.h"
 
 // blueberry
 #include <berryConstants.h>
 #include <berryIWorkbenchPage.h>
 
 // mitk
 #include "mitkApplicationCursor.h"
 #include "mitkLabelSetImage.h"
 #include "mitkStatusBar.h"
 #include "mitkToolManagerProvider.h"
 #include "mitkInteractionEventObserver.h"
 #include "mitkPlanePositionManager.h"
 #include "mitkPluginActivator.h"
 #include "mitkSegTool2D.h"
 #include "mitkImageTimeSelector.h"
 #include "mitkNodePredicateSubGeometry.h"
 
 // Qmitk
 #include <QmitkStyleManager.h>
 #include "QmitkNewSegmentationDialog.h"
 #include "QmitkRenderWindow.h"
 #include "QmitkSegmentationOrganNamesHandling.cpp"
 #include "QmitkCreateMultiLabelPresetAction.h"
 #include "QmitkLoadMultiLabelPresetAction.h"
 
 // us
 #include <usGetModuleContext.h>
 #include <usModule.h>
 #include <usModuleContext.h>
 #include <usModuleResource.h>
 #include <usModuleResourceStream.h>
 
 // Qt
 #include <QDateTime>
 #include <QFileDialog>
 #include <QInputDialog>
 #include <QMessageBox>
 #include <QShortcut>
 
-#include "tinyxml.h"
-
 #include <itksys/SystemTools.hxx>
 
 #include <regex>
 
 const std::string QmitkMultiLabelSegmentationView::VIEW_ID = "org.mitk.views.multilabelsegmentation";
 
 QmitkMultiLabelSegmentationView::QmitkMultiLabelSegmentationView()
   : m_Parent(nullptr),
     m_IRenderWindowPart(nullptr),
     m_ToolManager(nullptr),
     m_ReferenceNode(nullptr),
     m_WorkingNode(nullptr),
     m_AutoSelectionEnabled(false),
     m_MouseCursorSet(false)
 {
   m_SegmentationPredicate = mitk::NodePredicateAnd::New();
   m_SegmentationPredicate->AddPredicate(mitk::TNodePredicateDataType<mitk::LabelSetImage>::New());
   m_SegmentationPredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
 
   mitk::TNodePredicateDataType<mitk::Image>::Pointer isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
   mitk::NodePredicateProperty::Pointer isBinary =
     mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
   mitk::NodePredicateAnd::Pointer isMask = mitk::NodePredicateAnd::New(isBinary, isImage);
 
   mitk::NodePredicateDataType::Pointer isDwi = mitk::NodePredicateDataType::New("DiffusionImage");
   mitk::NodePredicateDataType::Pointer isDti = mitk::NodePredicateDataType::New("TensorImage");
   mitk::NodePredicateDataType::Pointer isOdf = mitk::NodePredicateDataType::New("OdfImage");
   auto isSegment = mitk::NodePredicateDataType::New("Segment");
 
   mitk::NodePredicateOr::Pointer validImages = mitk::NodePredicateOr::New();
   validImages->AddPredicate(mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isSegment)));
   validImages->AddPredicate(isDwi);
   validImages->AddPredicate(isDti);
   validImages->AddPredicate(isOdf);
 
   m_ReferencePredicate = mitk::NodePredicateAnd::New();
   m_ReferencePredicate->AddPredicate(validImages);
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(m_SegmentationPredicate));
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(isMask));
   m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
 }
 
 QmitkMultiLabelSegmentationView::~QmitkMultiLabelSegmentationView()
 {
   // Loose LabelSetConnections
   OnLooseLabelSetConnection();
 }
 
 void QmitkMultiLabelSegmentationView::CreateQtPartControl(QWidget *parent)
 {
   // setup the basic GUI of this view
   m_Parent = parent;
 
   m_Controls.setupUi(parent);
 
   m_Controls.m_tbSavePreset->setIcon(QmitkStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/document-save.svg")));
   m_Controls.m_tbLoadPreset->setIcon(QmitkStyleManager::ThemeIcon(QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/document-open.svg")));
 
   // *------------------------
   // * Shortcuts
   // *------------------------
   QShortcut* visibilityShortcut = new QShortcut(QKeySequence("CTRL+H"), parent);
   connect(visibilityShortcut, &QShortcut::activated, this, &QmitkMultiLabelSegmentationView::OnVisibilityShortcutActivated);
   QShortcut* labelToggleShortcut = new QShortcut(QKeySequence("CTRL+L"), parent);
   connect(labelToggleShortcut, &QShortcut::activated, this, &QmitkMultiLabelSegmentationView::OnLabelToggleShortcutActivated);
 
   // *------------------------
   // * DATA SELECTION WIDGETS
   // *------------------------
 
   m_Controls.m_ReferenceNodeSelector->SetNodePredicate(m_ReferencePredicate);
   m_Controls.m_ReferenceNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.m_ReferenceNodeSelector->SetInvalidInfo("Select an image");
   m_Controls.m_ReferenceNodeSelector->SetPopUpTitel("Select an image");
   m_Controls.m_ReferenceNodeSelector->SetPopUpHint("Select an image that should be used to define the geometry and bounds of the segmentation.");
 
 
   m_Controls.m_WorkingNodeSelector->SetNodePredicate(m_SegmentationPredicate);
   m_Controls.m_WorkingNodeSelector->SetDataStorage(this->GetDataStorage());
   m_Controls.m_WorkingNodeSelector->SetInvalidInfo("Select a segmentation");
   m_Controls.m_WorkingNodeSelector->SetPopUpTitel("Select a segmentation");
   m_Controls.m_WorkingNodeSelector->SetPopUpHint("Select a segmentation that should be modified. Only segmentation with the same geometry and within the bounds of the reference image are selected.");
 
   connect(m_Controls.m_ReferenceNodeSelector,
           &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
           this,&QmitkMultiLabelSegmentationView::OnReferenceSelectionChanged);
   connect(m_Controls.m_WorkingNodeSelector,
           &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
           this,&QmitkMultiLabelSegmentationView::OnSegmentationSelectionChanged);
 
   // *------------------------
   // * ToolManager
   // *------------------------
 
   m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager(mitk::ToolManagerProvider::MULTILABEL_SEGMENTATION);
   m_ToolManager->SetDataStorage(*(this->GetDataStorage()));
   m_ToolManager->InitializeTools();
   m_Controls.m_ManualToolSelectionBox2D->SetToolManager(*m_ToolManager);
   m_Controls.m_ManualToolSelectionBox3D->SetToolManager(*m_ToolManager);
 
   // *------------------------
   // * LabelSetWidget
   // *------------------------
 
   m_Controls.m_LabelSetWidget->SetDataStorage(this->GetDataStorage());
   m_Controls.m_LabelSetWidget->SetOrganColors(mitk::OrganNamesHandling::GetDefaultOrganColorString());
   m_Controls.m_LabelSetWidget->hide();
 
   // *------------------------
   // * Interpolation
   // *------------------------
 
   m_Controls.m_SurfaceBasedInterpolatorWidget->SetDataStorage(*(this->GetDataStorage()));
   m_Controls.m_SliceBasedInterpolatorWidget->SetDataStorage(*(this->GetDataStorage()));
   connect(m_Controls.m_cbInterpolation, SIGNAL(activated(int)), this, SLOT(OnInterpolationSelectionChanged(int)));
 
   m_Controls.m_cbInterpolation->setCurrentIndex(0);
   m_Controls.m_swInterpolation->hide();
 
   m_Controls.m_gbInterpolation->hide(); // See T27436
 
   QString segTools2D = tr("Add Subtract Fill Erase Paint Wipe 'Region Growing' FastMarching2D Correction 'Live Wire'");
   QString segTools3D = tr("Threshold 'Two Thresholds' 'Auto Threshold' 'Multiple Otsu'");
 
   std::regex extSegTool2DRegEx("SegTool2D$");
   std::regex extSegTool3DRegEx("SegTool3D$");
 
   auto tools = m_ToolManager->GetTools();
 
   for (const auto &tool : tools)
   {
     if (std::regex_search(tool->GetNameOfClass(), extSegTool2DRegEx))
     {
       segTools2D.append(QString(" '%1'").arg(tool->GetName()));
     }
     else if (std::regex_search(tool->GetNameOfClass(), extSegTool3DRegEx))
     {
       segTools3D.append(QString(" '%1'").arg(tool->GetName()));
     }
   }
 
   // *------------------------
   // * ToolSelection 2D
   // *------------------------
 
   m_Controls.m_ManualToolSelectionBox2D->SetGenerateAccelerators(true);
   m_Controls.m_ManualToolSelectionBox2D->SetToolGUIArea(m_Controls.m_ManualToolGUIContainer2D);
   m_Controls.m_ManualToolSelectionBox2D->SetDisplayedToolGroups(segTools2D.toStdString()); // todo: "Correction
   // 'Live Wire'"
   m_Controls.m_ManualToolSelectionBox2D->SetEnabledMode(
     QmitkToolSelectionBox::EnabledWithReferenceAndWorkingDataVisible);
   connect(m_Controls.m_ManualToolSelectionBox2D, SIGNAL(ToolSelected(int)), this, SLOT(OnManualTool2DSelected(int)));
 
   // *------------------------
   // * ToolSelection 3D
   // *------------------------
 
   m_Controls.m_ManualToolSelectionBox3D->SetGenerateAccelerators(true);
   m_Controls.m_ManualToolSelectionBox3D->SetToolGUIArea(m_Controls.m_ManualToolGUIContainer3D);
   m_Controls.m_ManualToolSelectionBox3D->SetDisplayedToolGroups(segTools3D.toStdString()); // todo add : FastMarching3D RegionGrowing Watershed
   m_Controls.m_ManualToolSelectionBox3D->SetLayoutColumns(2);
   m_Controls.m_ManualToolSelectionBox3D->SetEnabledMode(
     QmitkToolSelectionBox::EnabledWithReferenceAndWorkingDataVisible);
 
   // *------------------------*
   // * Connect PushButtons (pb)
   // *------------------------*
 
   connect(m_Controls.m_pbNewLabel, SIGNAL(clicked()), this, SLOT(OnNewLabel()));
   connect(m_Controls.m_tbSavePreset, SIGNAL(clicked()), this, SLOT(OnSavePreset()));
   connect(m_Controls.m_tbLoadPreset, SIGNAL(clicked()), this, SLOT(OnLoadPreset()));
   connect(m_Controls.m_pbNewSegmentationSession, SIGNAL(clicked()), this, SLOT(OnNewSegmentationSession()));
   connect(m_Controls.m_pbShowLabelTable, SIGNAL(toggled(bool)), this, SLOT(OnShowLabelTable(bool)));
 
   // *------------------------*
   // * Connect LabelSetWidget
   // *------------------------*
 
   connect(m_Controls.m_LabelSetWidget,
           SIGNAL(goToLabel(const mitk::Point3D &)),
           this,
           SLOT(OnGoToLabel(const mitk::Point3D &)));
   connect(m_Controls.m_LabelSetWidget, SIGNAL(resetView()), this, SLOT(OnResetView()));
 
   // *------------------------*
   // * DATA SLECTION WIDGET
   // *------------------------*
   m_IRenderWindowPart = this->GetRenderWindowPart();
   if (m_IRenderWindowPart)
   {
     QList<mitk::SliceNavigationController *> controllers;
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController());
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController());
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController());
     m_Controls.m_SliceBasedInterpolatorWidget->SetSliceNavigationControllers(controllers);
   }
 
   //  this->InitializeListeners();
 
   connect(m_Controls.m_btAddLayer, SIGNAL(clicked()), this, SLOT(OnAddLayer()));
   connect(m_Controls.m_btDeleteLayer, SIGNAL(clicked()), this, SLOT(OnDeleteLayer()));
   connect(m_Controls.m_btPreviousLayer, SIGNAL(clicked()), this, SLOT(OnPreviousLayer()));
   connect(m_Controls.m_btNextLayer, SIGNAL(clicked()), this, SLOT(OnNextLayer()));
   connect(m_Controls.m_btLockExterior, SIGNAL(toggled(bool)), this, SLOT(OnLockExteriorToggled(bool)));
   connect(m_Controls.m_cbActiveLayer, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChangeLayer(int)));
 
   m_Controls.m_btAddLayer->setEnabled(false);
   m_Controls.m_btDeleteLayer->setEnabled(false);
   m_Controls.m_btNextLayer->setEnabled(false);
   m_Controls.m_btPreviousLayer->setEnabled(false);
   m_Controls.m_cbActiveLayer->setEnabled(false);
 
   m_Controls.m_pbNewLabel->setEnabled(false);
   m_Controls.m_btLockExterior->setEnabled(false);
   m_Controls.m_tbSavePreset->setEnabled(false);
   m_Controls.m_tbLoadPreset->setEnabled(false);
   m_Controls.m_pbShowLabelTable->setEnabled(false);
 
   // Make sure the GUI notices if appropriate data is already present on creation
   m_Controls.m_ReferenceNodeSelector->SetAutoSelectNewNodes(true);
   m_Controls.m_WorkingNodeSelector->SetAutoSelectNewNodes(true);
 }
 
 void QmitkMultiLabelSegmentationView::Activated()
 {
   m_ToolManager->SetReferenceData(m_Controls.m_ReferenceNodeSelector->GetSelectedNode());
   m_ToolManager->SetWorkingData(m_Controls.m_WorkingNodeSelector->GetSelectedNode());
 }
 
 void QmitkMultiLabelSegmentationView::Deactivated()
 {
   // Not yet implemented
 }
 
 void QmitkMultiLabelSegmentationView::Visible()
 {
   // Not yet implemented
 }
 
 void QmitkMultiLabelSegmentationView::Hidden()
 {
   // Not yet implemented
 }
 
 int QmitkMultiLabelSegmentationView::GetSizeFlags(bool width)
 {
   if (!width)
   {
     return berry::Constants::MIN | berry::Constants::MAX | berry::Constants::FILL;
   }
   else
   {
     return 0;
   }
 }
 
 int QmitkMultiLabelSegmentationView::ComputePreferredSize(bool width,
                                                           int /*availableParallel*/,
                                                           int /*availablePerpendicular*/,
                                                           int preferredResult)
 {
   if (width == false)
   {
     return 100;
   }
   else
   {
     return preferredResult;
   }
 }
 
 /************************************************************************/
 /* protected slots                                                      */
 /************************************************************************/
 void QmitkMultiLabelSegmentationView::OnVisibilityShortcutActivated()
 {
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   bool isVisible = false;
   workingNode->GetBoolProperty("visible", isVisible);
   workingNode->SetVisibility(!isVisible);
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkMultiLabelSegmentationView::OnLabelToggleShortcutActivated()
 {
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   assert(workingImage);
 
   WaitCursorOn();
   workingImage->GetActiveLabelSet()->SetNextActiveLabel();
   workingImage->Modified();
   WaitCursorOff();
 
   mitk::RenderingManager::GetInstance()->RequestUpdateAll();
 }
 
 void QmitkMultiLabelSegmentationView::OnManualTool2DSelected(int id)
 {
   this->ResetMouseCursor();
   mitk::StatusBar::GetInstance()->DisplayText("");
 
   if (id >= 0)
   {
     std::string text = "Active Tool: \"";
     text += m_ToolManager->GetToolById(id)->GetName();
     text += "\"";
     mitk::StatusBar::GetInstance()->DisplayText(text.c_str());
 
     us::ModuleResource resource = m_ToolManager->GetToolById(id)->GetCursorIconResource();
     this->SetMouseCursor(resource, 0, 0);
   }
 }
 
 void QmitkMultiLabelSegmentationView::OnNewLabel()
 {
   m_ToolManager->ActivateTool(-1);
 
   if (m_ReferenceNode.IsNull())
   {
     QMessageBox::information(
       m_Parent, "New Segmentation Session", "Please load and select a patient image before starting some action.");
     return;
   }
 
   if (nullptr == m_ReferenceNode->GetData())
   {
     QMessageBox::information(
       m_Parent, "New Segmentation Session", "Please load and select a patient image before starting some action.");
     return;
   }
 
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   if (!workingNode)
   {
     QMessageBox::information(
       m_Parent, "New Segmentation Session", "Please load and select a patient image before starting some action.");
     return;
   }
 
   mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   if (!workingImage)
   {
     QMessageBox::information(
       m_Parent, "New Segmentation Session", "Please load and select a patient image before starting some action.");
     return;
   }
 
   QmitkNewSegmentationDialog* dialog = new QmitkNewSegmentationDialog(m_Parent);
   dialog->SetSuggestionList(mitk::OrganNamesHandling::GetDefaultOrganColorString());
   dialog->setWindowTitle("New Label");
 
   int dialogReturnValue = dialog->exec();
   if (dialogReturnValue == QDialog::Rejected)
   {
     return;
   }
 
   QString segName = dialog->GetSegmentationName();
   if (segName.isEmpty())
   {
     segName = "Unnamed";
   }
   workingImage->GetActiveLabelSet()->AddLabel(segName.toStdString(), dialog->GetColor());
 
   UpdateControls();
   m_Controls.m_LabelSetWidget->ResetAllTableWidgetItems();
 
   this->ReinitializeViews();
 }
 
 void QmitkMultiLabelSegmentationView::OnSavePreset()
 {
   QmitkAbstractNodeSelectionWidget::NodeList nodes;
   nodes.append(m_WorkingNode);
 
   QmitkCreateMultiLabelPresetAction action;
   action.Run(nodes);
 }
 
 void QmitkMultiLabelSegmentationView::OnLoadPreset()
 {
   QmitkAbstractNodeSelectionWidget::NodeList nodes;
   nodes.append(m_WorkingNode);
 
   QmitkLoadMultiLabelPresetAction action;
   action.Run(nodes);
 }
 
 void QmitkMultiLabelSegmentationView::OnShowLabelTable(bool value)
 {
   if (value)
     m_Controls.m_LabelSetWidget->show();
   else
     m_Controls.m_LabelSetWidget->hide();
 }
 
 void QmitkMultiLabelSegmentationView::OnNewSegmentationSession()
 {
   mitk::DataNode *referenceNode = m_Controls.m_ReferenceNodeSelector->GetSelectedNode();
 
   if (!referenceNode)
   {
     QMessageBox::information(
       m_Parent, "New Segmentation Session", "Please load and select a patient image before starting some action.");
     return;
   }
 
   m_ToolManager->ActivateTool(-1);
 
   mitk::Image::ConstPointer referenceImage = dynamic_cast<mitk::Image*>(referenceNode->GetData());
   assert(referenceImage);
 
   const auto currentTimePoint = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
   unsigned int imageTimeStep = 0;
   if (referenceImage->GetTimeGeometry()->IsValidTimePoint(currentTimePoint))
   {
     imageTimeStep = referenceImage->GetTimeGeometry()->TimePointToTimeStep(currentTimePoint);
   }
 
   auto segTemplateImage = referenceImage;
   if (referenceImage->GetDimension() > 3)
   {
     auto result = QMessageBox::question(m_Parent, tr("Generate a static mask?"), tr("The selected image has multiple time steps. You can either generate a simple/static masks resembling the geometry of the first timestep of the image. Or you can generate a dynamic mask that equals the selected image in geometry and number of timesteps; thus a dynamic mask can change over time (e.g. according to the image)."), tr("Yes, generate a static mask"), tr("No, generate a dynamic mask"), QString(), 0, 0);
     if (result == 0)
     {
       auto selector = mitk::ImageTimeSelector::New();
       selector->SetInput(referenceImage);
       selector->SetTimeNr(0);
       selector->Update();
 
       const auto refTimeGeometry = referenceImage->GetTimeGeometry();
       auto newTimeGeometry = mitk::ProportionalTimeGeometry::New();
       newTimeGeometry->SetFirstTimePoint(refTimeGeometry->GetMinimumTimePoint());
       newTimeGeometry->SetStepDuration(refTimeGeometry->GetMaximumTimePoint() - refTimeGeometry->GetMinimumTimePoint());
 
       mitk::Image::Pointer newImage = selector->GetOutput();
       newTimeGeometry->SetTimeStepGeometry(referenceImage->GetGeometry(imageTimeStep), 0);
       newImage->SetTimeGeometry(newTimeGeometry);
       segTemplateImage = newImage;
     }
   }
 
   QString newName = QString::fromStdString(referenceNode->GetName());
   newName.append("-labels");
 
   bool ok = false;
   newName = QInputDialog::getText(m_Parent, "New Segmentation Session", "New name:", QLineEdit::Normal, newName, &ok);
 
   if (!ok)
   {
     return;
   }
   this->WaitCursorOn();
 
   mitk::LabelSetImage::Pointer workingImage = mitk::LabelSetImage::New();
   try
   {
     workingImage->Initialize(segTemplateImage);
   }
   catch (mitk::Exception& e)
   {
     this->WaitCursorOff();
     MITK_ERROR << "Exception caught: " << e.GetDescription();
     QMessageBox::information(m_Parent, "New Segmentation Session", "Could not create a new segmentation session.\n");
     return;
   }
 
   this->WaitCursorOff();
 
   mitk::DataNode::Pointer workingNode = mitk::DataNode::New();
   workingNode->SetData(workingImage);
   workingNode->SetName(newName.toStdString());
 
   workingImage->GetExteriorLabel()->SetProperty("name.parent", mitk::StringProperty::New(referenceNode->GetName().c_str()));
   workingImage->GetExteriorLabel()->SetProperty("name.image", mitk::StringProperty::New(newName.toStdString().c_str()));
 
   if (!GetDataStorage()->Exists(workingNode))
   {
     GetDataStorage()->Add(workingNode, referenceNode);
   }
 
   m_Controls.m_WorkingNodeSelector->SetCurrentSelectedNode(workingNode);
 
   OnNewLabel();
 }
 
 void QmitkMultiLabelSegmentationView::OnGoToLabel(const mitk::Point3D& pos)
 {
   if (m_IRenderWindowPart)
     m_IRenderWindowPart->SetSelectedPosition(pos);
 }
 
 void QmitkMultiLabelSegmentationView::OnResetView()
 {
   if (m_IRenderWindowPart)
     m_IRenderWindowPart->ForceImmediateUpdate();
 }
 
 void QmitkMultiLabelSegmentationView::OnAddLayer()
 {
   m_ToolManager->ActivateTool(-1);
 
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   assert(workingImage);
 
   QString question = "Do you really want to add a layer to the current segmentation session?";
   QMessageBox::StandardButton answerButton = QMessageBox::question(
     m_Controls.m_LabelSetWidget, "Add layer", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
 
   if (answerButton != QMessageBox::Yes) return;
 
   try
   {
     WaitCursorOn();
     workingImage->AddLayer();
     WaitCursorOff();
   }
   catch ( mitk::Exception& e )
   {
     WaitCursorOff();
     MITK_ERROR << "Exception caught: " << e.GetDescription();
     QMessageBox::information(
       m_Controls.m_LabelSetWidget, "Add Layer", "Could not add a new layer. See error log for details.\n");
     return;
   }
 
   OnNewLabel();
 }
 
 void QmitkMultiLabelSegmentationView::OnDeleteLayer()
 {
   m_ToolManager->ActivateTool(-1);
 
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   assert(workingImage);
 
   if (workingImage->GetNumberOfLayers() < 2)
     return;
 
   QString question = "Do you really want to delete the current layer?";
 
   QMessageBox::StandardButton answerButton = QMessageBox::question(
     m_Controls.m_LabelSetWidget, "Delete layer", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
 
   if (answerButton != QMessageBox::Yes)
   {
     return;
   }
 
   try
   {
     this->WaitCursorOn();
     workingImage->RemoveLayer();
     this->WaitCursorOff();
   }
   catch (mitk::Exception& e)
   {
     this->WaitCursorOff();
     MITK_ERROR << "Exception caught: " << e.GetDescription();
     QMessageBox::information(m_Controls.m_LabelSetWidget, "Delete Layer",
                              "Could not delete the currently active layer. See error log for details.\n");
     return;
   }
 
   UpdateControls();
   m_Controls.m_LabelSetWidget->ResetAllTableWidgetItems();
 }
 
 void QmitkMultiLabelSegmentationView::OnPreviousLayer()
 {
   m_ToolManager->ActivateTool(-1);
 
   mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
   mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
   assert(workingImage);
 
   OnChangeLayer(workingImage->GetActiveLayer() - 1);
 }
 
 void QmitkMultiLabelSegmentationView::OnNextLayer()
 {
   m_ToolManager->ActivateTool(-1);
 
   mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
   mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
   assert(workingImage);
 
   OnChangeLayer(workingImage->GetActiveLayer() + 1);
 }
 
 void QmitkMultiLabelSegmentationView::OnChangeLayer(int layer)
 {
   m_ToolManager->ActivateTool(-1);
 
   mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
   assert(workingImage);
 
   this->WaitCursorOn();
   workingImage->SetActiveLayer(layer);
   this->WaitCursorOff();
 
   UpdateControls();
   m_Controls.m_LabelSetWidget->ResetAllTableWidgetItems();
 }
 
 void QmitkMultiLabelSegmentationView::OnDeactivateActiveTool()
 {
   m_ToolManager->ActivateTool(-1);
 }
 
 void QmitkMultiLabelSegmentationView::OnLockExteriorToggled(bool checked)
 {
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   assert(workingNode);
 
   mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
   assert(workingImage);
 
   workingImage->GetLabel(0)->SetLocked(checked);
 }
 
 void QmitkMultiLabelSegmentationView::OnReferenceSelectionChanged(QList<mitk::DataNode::Pointer> /*nodes*/)
 {
   m_ToolManager->ActivateTool(-1);
 
   auto refNode = m_Controls.m_ReferenceNodeSelector->GetSelectedNode();
   m_ReferenceNode = refNode;
   m_ToolManager->SetReferenceData(m_ReferenceNode);
 
   if (m_ReferenceNode.IsNotNull())
   {
     auto segPredicate = mitk::NodePredicateAnd::New(m_SegmentationPredicate.GetPointer(), mitk::NodePredicateSubGeometry::New(refNode->GetData()->GetGeometry()));
 
     m_Controls.m_WorkingNodeSelector->SetNodePredicate(segPredicate);
 
     if (m_AutoSelectionEnabled)
     {
       // hide all image nodes to later show only the automatically selected ones
       mitk::DataStorage::SetOfObjects::ConstPointer patientNodes = GetDataStorage()->GetSubset(m_ReferencePredicate);
       for (mitk::DataStorage::SetOfObjects::const_iterator iter = patientNodes->begin(); iter != patientNodes->end(); ++iter)
       {
         (*iter)->SetVisibility(false);
       }
     }
     m_ReferenceNode->SetVisibility(true);
   }
 
   UpdateControls();
 }
 
 void QmitkMultiLabelSegmentationView::OnSegmentationSelectionChanged(QList<mitk::DataNode::Pointer> /*nodes*/)
 {
   m_ToolManager->ActivateTool(-1);
 
   if (m_WorkingNode.IsNotNull())
     OnLooseLabelSetConnection();
 
   m_WorkingNode = m_Controls.m_WorkingNodeSelector->GetSelectedNode();
   m_ToolManager->SetWorkingData(m_WorkingNode);
   if (m_WorkingNode.IsNotNull())
   {
     OnEstablishLabelSetConnection();
 
     if (m_AutoSelectionEnabled)
     {
       // hide all segmentation nodes to later show only the automatically selected ones
       mitk::DataStorage::SetOfObjects::ConstPointer segmentationNodes = GetDataStorage()->GetSubset(m_SegmentationPredicate);
       for (mitk::DataStorage::SetOfObjects::const_iterator iter = segmentationNodes->begin(); iter != segmentationNodes->end(); ++iter)
       {
         (*iter)->SetVisibility(false);
       }
     }
     m_WorkingNode->SetVisibility(true);
   }
 
   UpdateControls();
   if (m_WorkingNode.IsNotNull())
   {
     m_Controls.m_LabelSetWidget->ResetAllTableWidgetItems();
     this->ReinitializeViews();
   }
 }
 
 void QmitkMultiLabelSegmentationView::OnInterpolationSelectionChanged(int index)
 {
   if (index == 1)
   {
     m_Controls.m_SurfaceBasedInterpolatorWidget->m_Controls.m_btStart->setChecked(false);//OnToggleWidgetActivation(false);
     m_Controls.m_swInterpolation->setCurrentIndex(0);
     m_Controls.m_swInterpolation->show();
   }
   else if (index == 2)
   {
     m_Controls.m_SliceBasedInterpolatorWidget->m_Controls.m_btStart->setChecked(false);
     m_Controls.m_swInterpolation->setCurrentIndex(1);
     m_Controls.m_swInterpolation->show();
   }
   else
   {
     m_Controls.m_SurfaceBasedInterpolatorWidget->m_Controls.m_btStart->setChecked(false);
     m_Controls.m_SliceBasedInterpolatorWidget->m_Controls.m_btStart->setChecked(false);
     m_Controls.m_swInterpolation->setCurrentIndex(2);
     m_Controls.m_swInterpolation->hide();
   }
 }
 
 /************************************************************************/
 /* protected                                                            */
 /************************************************************************/
 void QmitkMultiLabelSegmentationView::OnPreferencesChanged(const berry::IBerryPreferences* prefs)
 {
   if (m_Parent && m_WorkingNode.IsNotNull())
   {
     m_AutoSelectionEnabled = prefs->GetBool("auto selection", false);
 
     mitk::BoolProperty::Pointer drawOutline = mitk::BoolProperty::New(prefs->GetBool("draw outline", true));
     mitk::BoolProperty::Pointer volumeRendering = mitk::BoolProperty::New(prefs->GetBool("volume rendering", false));
     mitk::LabelSetImage* labelSetImage;
     mitk::DataNode* segmentation;
 
     // iterate all segmentations (binary (single label) and LabelSetImages)
     mitk::NodePredicateProperty::Pointer isBinaryPredicate = mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true));
     mitk::NodePredicateOr::Pointer allSegmentationsPredicate = mitk::NodePredicateOr::New(isBinaryPredicate, m_SegmentationPredicate);
     mitk::DataStorage::SetOfObjects::ConstPointer allSegmentations = GetDataStorage()->GetSubset(allSegmentationsPredicate);
 
     for (mitk::DataStorage::SetOfObjects::const_iterator it = allSegmentations->begin(); it != allSegmentations->end(); ++it)
     {
       segmentation = *it;
       labelSetImage = dynamic_cast<mitk::LabelSetImage*>(segmentation->GetData());
       if (nullptr != labelSetImage)
       {
         // segmentation node is a multi label segmentation
         segmentation->SetProperty("labelset.contour.active", drawOutline);
         //segmentation->SetProperty("opacity", mitk::FloatProperty::New(drawOutline->GetValue() ? 1.0f : 0.3f));
         segmentation->SetProperty("volumerendering", volumeRendering);
         // force render window update to show outline
         segmentation->GetData()->Modified();
       }
       else if (nullptr != segmentation->GetData())
       {
         // node is actually a 'single label' segmentation,
         // but its outline property can be set in the 'multi label' segmentation preference page as well
         bool isBinary = false;
         segmentation->GetBoolProperty("binary", isBinary);
         if (isBinary)
         {
           segmentation->SetProperty("outline binary", drawOutline);
           segmentation->SetProperty("outline width", mitk::FloatProperty::New(2.0));
           //segmentation->SetProperty("opacity", mitk::FloatProperty::New(drawOutline->GetValue() ? 1.0f : 0.3f));
           segmentation->SetProperty("volumerendering", volumeRendering);
           // force render window update to show outline
           segmentation->GetData()->Modified();
         }
       }
       else
       {
         // "interpolation feedback" data nodes have binary flag but don't have a data set. So skip them for now.
         MITK_INFO << "DataNode " << segmentation->GetName() << " doesn't contain a base data.";
       }
     }
   }
 }
 
 void QmitkMultiLabelSegmentationView::NodeRemoved(const mitk::DataNode *node)
 {
   bool isHelperObject(false);
   node->GetBoolProperty("helper object", isHelperObject);
   if (isHelperObject)
   {
     return;
   }
 
   if (m_ReferenceNode.IsNotNull() && dynamic_cast<mitk::LabelSetImage *>(node->GetData()))
   {
     // remove all possible contour markers of the segmentation
     mitk::DataStorage::SetOfObjects::ConstPointer allContourMarkers = this->GetDataStorage()->GetDerivations(
       node, mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true)));
 
     ctkPluginContext *context = mitk::PluginActivator::getContext();
     ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
     mitk::PlanePositionManagerService *service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
 
     for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End(); ++it)
     {
       std::string nodeName = node->GetName();
       unsigned int t = nodeName.find_last_of(" ");
       unsigned int id = atof(nodeName.substr(t + 1).c_str()) - 1;
 
       service->RemovePlanePosition(id);
 
       this->GetDataStorage()->Remove(it->Value());
     }
 
     context->ungetService(ppmRef);
     service = nullptr;
   }
 }
 
 void QmitkMultiLabelSegmentationView::OnEstablishLabelSetConnection()
 {
   if (m_WorkingNode.IsNull())
   {
     return;
   }
   mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(m_WorkingNode->GetData());
   assert(workingImage);
 
   workingImage->GetActiveLabelSet()->AddLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->RemoveLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->ModifyLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->AllLabelsModifiedEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->ActiveLabelEvent +=
     mitk::MessageDelegate1<QmitkLabelSetWidget, mitk::Label::PixelType>(m_Controls.m_LabelSetWidget,
                                                                         &QmitkLabelSetWidget::SelectLabelByPixelValue);
 
   // Removed in T27851 to have a chance to react to AfterChangeLayerEvent. Did it brake something?
   // workingImage->BeforeChangeLayerEvent += mitk::MessageDelegate<QmitkMultiLabelSegmentationView>(
   //   this, &QmitkMultiLabelSegmentationView::OnLooseLabelSetConnection);
 
   workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<QmitkMultiLabelSegmentationView>(
     this, &QmitkMultiLabelSegmentationView::UpdateControls);
 }
 
 void QmitkMultiLabelSegmentationView::OnLooseLabelSetConnection()
 {
   if (m_WorkingNode.IsNull())
     return;
 
   auto* workingImage = dynamic_cast<mitk::LabelSetImage *>(m_WorkingNode->GetData());
 
   if (nullptr == workingImage)
     return; // data (type) was changed in-place, e.g. LabelSetImage -> Image
 
   // Reset LabelSetWidget Events
   workingImage->GetActiveLabelSet()->AddLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->ModifyLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->AllLabelsModifiedEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
     m_Controls.m_LabelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
   workingImage->GetActiveLabelSet()->ActiveLabelEvent -=
     mitk::MessageDelegate1<QmitkLabelSetWidget, mitk::Label::PixelType>(m_Controls.m_LabelSetWidget,
                                                                         &QmitkLabelSetWidget::SelectLabelByPixelValue);
 
   // Removed in T27851 to have a chance to react to AfterChangeLayerEvent. Did it brake something?
   // workingImage->BeforeChangeLayerEvent -= mitk::MessageDelegate<QmitkMultiLabelSegmentationView>(
   //   this, &QmitkMultiLabelSegmentationView::OnLooseLabelSetConnection);
 
   workingImage->AfterChangeLayerEvent -= mitk::MessageDelegate<QmitkMultiLabelSegmentationView>(
     this, &QmitkMultiLabelSegmentationView::UpdateControls);
 }
 
 void QmitkMultiLabelSegmentationView::SetFocus()
 {
 }
 
 void QmitkMultiLabelSegmentationView::UpdateControls()
 {
   mitk::DataNode* referenceNode = m_ToolManager->GetReferenceData(0);
   bool hasReferenceNode = referenceNode != nullptr;
 
   mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
   bool hasValidWorkingNode = workingNode != nullptr;
 
   m_Controls.m_pbNewLabel->setEnabled(false);
   m_Controls.m_gbInterpolation->setEnabled(false);
   m_Controls.m_SliceBasedInterpolatorWidget->setEnabled(false);
   m_Controls.m_SurfaceBasedInterpolatorWidget->setEnabled(false);
   m_Controls.m_LabelSetWidget->setEnabled(false);
   m_Controls.m_btAddLayer->setEnabled(false);
   m_Controls.m_btDeleteLayer->setEnabled(false);
   m_Controls.m_cbActiveLayer->setEnabled(false);
   m_Controls.m_btPreviousLayer->setEnabled(false);
   m_Controls.m_btNextLayer->setEnabled(false);
   m_Controls.m_btLockExterior->setChecked(false);
   m_Controls.m_btLockExterior->setEnabled(false);
   m_Controls.m_tbSavePreset->setEnabled(false);
   m_Controls.m_tbLoadPreset->setEnabled(false);
   m_Controls.m_pbShowLabelTable->setChecked(false);
   m_Controls.m_pbShowLabelTable->setEnabled(false);
 
   m_Controls.m_ManualToolSelectionBox3D->SetEnabledMode(QmitkToolSelectionBox::EnabledWithReferenceAndWorkingDataVisible);
   m_Controls.m_ManualToolSelectionBox2D->SetEnabledMode(QmitkToolSelectionBox::EnabledWithReferenceAndWorkingDataVisible);
 
   if (hasValidWorkingNode)
   {
     // TODO adapt tool manager so that this check is done there, e.g. convenience function
     mitk::LabelSetImage* workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
     hasValidWorkingNode = workingImage != nullptr;
     if (hasValidWorkingNode)
     {
       m_Controls.m_pbNewLabel->setEnabled(true);
       m_Controls.m_btLockExterior->setEnabled(true);
       m_Controls.m_tbSavePreset->setEnabled(true);
       m_Controls.m_tbLoadPreset->setEnabled(true);
       m_Controls.m_pbShowLabelTable->setEnabled(true);
       m_Controls.m_gbInterpolation->setEnabled(true);
       m_Controls.m_SliceBasedInterpolatorWidget->setEnabled(true);
       m_Controls.m_SurfaceBasedInterpolatorWidget->setEnabled(true);
       m_Controls.m_LabelSetWidget->setEnabled(true);
       m_Controls.m_btAddLayer->setEnabled(true);
 
       int activeLayer = workingImage->GetActiveLayer();
       int numberOfLayers = workingImage->GetNumberOfLayers();
 
       m_Controls.m_cbActiveLayer->blockSignals(true);
       m_Controls.m_cbActiveLayer->clear();
       for (unsigned int lidx = 0; lidx < workingImage->GetNumberOfLayers(); ++lidx)
       {
         m_Controls.m_cbActiveLayer->addItem(QString::number(lidx));
       }
       m_Controls.m_cbActiveLayer->setCurrentIndex(activeLayer);
       m_Controls.m_cbActiveLayer->blockSignals(false);
 
       m_Controls.m_cbActiveLayer->setEnabled(numberOfLayers > 1);
       m_Controls.m_btDeleteLayer->setEnabled(numberOfLayers > 1);
       m_Controls.m_btPreviousLayer->setEnabled(activeLayer > 0);
       m_Controls.m_btNextLayer->setEnabled(activeLayer != numberOfLayers - 1);
 
       m_Controls.m_btLockExterior->setChecked(workingImage->GetLabel(0, activeLayer)->GetLocked());
       m_Controls.m_pbShowLabelTable->setChecked(workingImage->GetNumberOfLabels() > 1 /*1st is exterior*/);
 
       //MLI TODO
       //m_Controls.m_ManualToolSelectionBox2D->SetEnabledMode(QmitkToolSelectionBox::EnabledWithWorkingDataVisible);
     }
   }
 
   if (hasValidWorkingNode && hasReferenceNode)
   {
     int layer = -1;
     referenceNode->GetIntProperty("layer", layer);
     workingNode->SetIntProperty("layer", layer + 1);
   }
 
   this->RequestRenderWindowUpdate(mitk::RenderingManager::REQUEST_UPDATE_ALL);
 }
 
 void QmitkMultiLabelSegmentationView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
 {
   if (m_IRenderWindowPart != renderWindowPart)
   {
     m_IRenderWindowPart = renderWindowPart;
     m_Parent->setEnabled(true);
 
     QList<mitk::SliceNavigationController*> controllers;
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController());
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController());
     controllers.push_back(m_IRenderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController());
     m_Controls.m_SliceBasedInterpolatorWidget->SetSliceNavigationControllers(controllers);
   }
 }
 
 void QmitkMultiLabelSegmentationView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
 {
   m_ToolManager->ActivateTool(-1);
   m_IRenderWindowPart = nullptr;
   m_Parent->setEnabled(false);
 }
 
 void QmitkMultiLabelSegmentationView::ResetMouseCursor()
 {
   if (m_MouseCursorSet)
   {
     mitk::ApplicationCursor::GetInstance()->PopCursor();
     m_MouseCursorSet = false;
   }
 }
 
 void QmitkMultiLabelSegmentationView::SetMouseCursor(const us::ModuleResource resource, int hotspotX, int hotspotY)
 {
   // Remove previously set mouse cursor
   if (m_MouseCursorSet)
     this->ResetMouseCursor();
 
   if (resource)
   {
     us::ModuleResourceStream cursor(resource, std::ios::binary);
     mitk::ApplicationCursor::GetInstance()->PushCursor(cursor, hotspotX, hotspotY);
     m_MouseCursorSet = true;
   }
 }
 
 void QmitkMultiLabelSegmentationView::InitializeListeners()
 {
   if (m_Interactor.IsNull())
   {
     us::Module* module = us::GetModuleContext()->GetModule();
     std::vector<us::ModuleResource> resources = module->FindResources("/", "*", true);
     for (std::vector<us::ModuleResource>::iterator iter = resources.begin(); iter != resources.end(); ++iter)
     {
       MITK_INFO << iter->GetResourcePath();
     }
 
     m_Interactor = mitk::SegmentationInteractor::New();
     if (!m_Interactor->LoadStateMachine("SegmentationInteraction.xml", module))
     {
       MITK_WARN << "Error loading state machine";
     }
 
     if (!m_Interactor->SetEventConfig("ConfigSegmentation.xml", module))
     {
       MITK_WARN << "Error loading state machine configuration";
     }
 
     // Register as listener via micro services
     us::ServiceProperties props;
     props["name"] = std::string("SegmentationInteraction");
     m_ServiceRegistration =
       us::GetModuleContext()->RegisterService<mitk::InteractionEventObserver>(m_Interactor.GetPointer(), props);
   }
 }
 
 void QmitkMultiLabelSegmentationView::ReinitializeViews() const
 {
   if (m_ReferenceNode.IsNotNull() && nullptr != m_ReferenceNode->GetData())
   {
     const auto currentTimePoint = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
     unsigned int imageTimeStep = 0;
     if (m_ReferenceNode->GetData()->GetTimeGeometry()->IsValidTimePoint(currentTimePoint))
     {
       imageTimeStep = m_ReferenceNode->GetData()->GetTimeGeometry()->TimePointToTimeStep(currentTimePoint);
     }
 
     mitk::RenderingManager::GetInstance()->InitializeViews(m_ReferenceNode->GetData()->GetTimeGeometry(), mitk::RenderingManager::REQUEST_UPDATE_ALL, true);
     mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetTime()->SetPos(imageTimeStep);
   }
 }