private ExcelWorksheetPanes[] LoadPanes() { XmlNodeList nodes = TopNode.SelectNodes("//d:selection", NameSpaceManager); if(nodes.Count==0) { return new ExcelWorksheetPanes[] { new ExcelWorksheetPanes(NameSpaceManager, TopNode) }; } else { ExcelWorksheetPanes[] panes = new ExcelWorksheetPanes[nodes.Count]; int i=0; foreach(XmlElement elem in nodes) { panes[i++] = new ExcelWorksheetPanes(NameSpaceManager, elem); } return panes; } }