There is no direct way of returning all required elements. However you can use XPath to get the deepest node(s) and then use node.parent method to read parent elements.
A simple XPath could be :
/VariableData/Lines/Line/Components/Component/SerialDetails/SerialDetail/SerialNumberRecord
or