Question : Combining XML data ---PLEASE HELP!

PLEASE HELP:
I have a huge problem that I need to find a remedy for.  I have a report that I need to generate that finds multiple system vulnerabilities and lists the data according to the vulnerabilites.  I have constructed the code to do exactly that (with the help of some Experts from here).

The problem lies in the fact that the same vulnerabilities are listed unde multiple different IP addresses or hosts.  The findings are correct however, the number of rows and findings are excessively massive because the same finding is repeated a couple thousand times (granted with different applicable IP addresses (hosts)).

I was wondering if there was a way to utilize the current code I have and list all the vulnerabilites and combine the affected hosts into that same row.

For example, I currently would get a list that would look something like this (the | are actually column breaks):

3  |   AIX 530008 : U825099  |   \nSynopsis :\n\nThe remote host is missing a vendor supplied security patch  |  192.168.1.1 |  Red Hat 8

3  |   AIX 530008 : U825099  |   \nSynopsis :\n\nThe remote host is missing a vendor supplied security patch  |  192.168.1.2 |  Red Hat 8

3  |   AIX 530008 : U825099  |   \nSynopsis :\n\nThe remote host is missing a vendor supplied security patch  |  192.168.1.3 |  Red Hat 8

I would like it to display as one single row for each vulnerability and have each affected system (IP) listed in that row.  Such as:

3  |   AIX 530008 : U825099  |   \nSynopsis :\n\nThe remote host is missing a vendor supplied security patch  |  192.168.1.1, 192.168.1.2, 192.168.1.3 (Line breaks would be better than commas so that the IPs are stacked on top of each other) |  Red Hat 8

This would save me a whole lot of problems since the current code that I have displays everything I want just in such a huge quantitiy that it would be very time consuming to go through it all.  I have the code that I am currently using listed below.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:



	
	Untitled Document
	


	


Open in New Window Select All

Answer : Combining XML data ---PLEASE HELP!

Take the supplied code

XML FILE : dns.xml





      
            09/03/18 08:14:55 AM - Default scan policy
            
                  192.168.1.101Name>
                  Wed Mar 18 08:14:55 2009
                  Wed Mar 18 10:23:47 2009
                  Server1s_name>
                  (unknown)>
                  SERVER1.
                  Microsoft Windows Server 2003, Enterprise Edition (English)
                  16
                  57
                  1
                  0
                  
                        general/tcp
                        1
                        10180
                        Ping the remote host
                        The remote host is up\n
                  

                  
                        test 2
                        3
                        999999
                        My Test 2
                        The problem 2 \n
                  

            

            
                  192.168.1.103Name>
                  Wed Mar 18 08:14:55 2009
                  Wed Mar 18 10:23:47 2009
                  Server1s_name>
                  (unknown)>
                  SERVER1.
                  Microsoft Windows Server 2003, Enterprise Edition (English)
                  16
                  57
                  1
                  0
                  
                        general/tcp
                        1
                        10180
                        Ping the remote host
                        The remote host is up\n
                  

            

      




1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:


	
	
		
		
			
				
				

Plugin ID:
Plugin ID Plugin Name Severity HOST IDS
Open in New Window Select All
Random Solutions  
 
programming4us programming4us