in reply to Parsing an xml file

What you were trying wasn't clear to me , so I did it as I see it. First, your xml isn't valid---the schema messed-up <build>. Second, I usually avoid glob when I do XML---better to use findnodes or something similar. Here's the script that I ran:
#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my @files = '/root/Desktop/your.xml'; my $parser = XML::LibXML->new(); foreach my $file( @files) { my $doc = $parser->parse_file($file); my $cmm_root_path_var = $doc->findnodes("//Test/*"); print $doc->to_literal(), "\n"; }
And I ran your xml through xmltidy. It's still not valid, but works for this test:
<?xml version="1.0" encoding="utf-8"?> <build> <name>lpass</name> <build_id>M8960AAAAANAAL1004</build_id> <windows_root_path cmm_root_path_var="PASS_BUILD_ROOT">\\TEST\M965 +0AAAAANAAL1004\</windows_root_path> <linux_root_path cmm_root_path_var="PASS_BUILD_ROOT" /> <image_dir>lpass_proc</image_dir> <name>rpm</name> <build_id>M8960AAAAANAAR1004</build_id> <windows_root_path cmm_root_path_var="PM_BUILD_ROOT">\\TEST\M9650AAA +AANAAR1004\</windows_root_path> <linux_root_path cmm_root_path_var="PM_BUILD_ROOT" /> <image_dir>rpm_proc</image_dir> <download_file> <file_name>rpm.mbn</file_name> <file_path>rpm_proc/</file_path> </download_file> <name>wcnss</name> <build_id>M8960AAAAANAAW1004</build_id> <windows_root_path cmm_root_path_var="NSS_BUILD_ROOT">\\TEST\M9650AA +AAANAAW1004\</windows_root_path> <linux_root_path cmm_root_path_var="NSS_BUILD_ROOT" /> <image_dir>wcnss_proc</image_dir> </build>