Use TMxpElement as a value class to avoid memory leaks.