class RemoteMapCatalog {

        public void parseXML(List<Workspace> workspaces,XMLStreamReader parser) throws XMLStreamException {
                List<String> hierarchy = new ArrayList<String>();
                // Hold workspace name
                StringBuilder characters = new StringBuilder();
                // Starting with a valid event, iterating while the parser
                // does not reach the end document XML tag
                for (int event = parser.next();
                        event != XMLStreamConstants.END_DOCUMENT;
                        event = parser.next()) {
                        // For each XML elements
                        switch(event) {
                                case XMLStreamConstants.START_ELEMENT:
                                        hierarchy.add(parser.getLocalName());
                                        break;
                                case XMLStreamConstants.END_ELEMENT:
                                        if(RemoteCommons.endsWith(hierarchy,"workspaces","workspace","name")) {
                                                workspaces.add(new Workspace(cParams,characters.toString().trim()));
                                        }
                                        hierarchy.remove(hierarchy.size()-1);
                                        characters = new StringBuilder(); // Clear the string buffer
                                        break;
                                case XMLStreamConstants.CHARACTERS:
                                        characters.append(StringEscapeUtils.unescapeHtml4(parser.getText()));
                                        break;
                        }                               
                }                
        }

        public  RemoteMapCatalog(ConnectionProperties connectionProperties);

}