in reply to XML Parsing,
Use Data::Dumper to print out the $config variable after you parse it. Do this with the bad file and with a good file so you can spot the difference. As the first commenter mentioned, you can likely pass an option to XMLIn called ForceArray so the Vehicle element is always an array (but will likely do it to other elements as well).
use Data::Dumper; ... $config = XMLin( $xml, SuppressEmpty => "" ); warn Dumper($config);