Recently, it was found by Schneider, using simulations, that scale-free networks with "onion structure" are very robust against targeted high degree attacks. The onion structure is a network where nodes with almost the same degree are connected. Motivated by this work, we propose and analyze, based on analytical considerations, an onionlike candidate for a nearly optimal structure against simultaneous random and targeted high degree node attacks. The nearly optimal structure can be viewed as a set of hierarchically interconnected random regular graphs,the degrees and populations of whose nodes are specified by the degree distribution. This network structure exhibits an extremely assortative degree-degree correlation and has a close relationship to the "onion structure." After deriving a set of exact expressions that enable us to calculate the critical percolation threshold and the giant component of a correlated network for an arbitrary type of node removal, we apply the theory to the cases of random scale-free networks that are highly vulnerable against targeted high degree node removal. Our results show that this vulnerability can be significantly reduced by implementing this onionlike type of degree-degree correlation without much undermining the almost complete robustness against random node removal. We also investigate in detail the robustness enhancement due to assortative degree-degree correlation by introducing a joint degree-degree probability matrix that interpolates between an uncorrelated network structure and the onionlike structure proposed here by tuning a single control parameter. The optimal values of the control parameter that maximize the robustness against simultaneous random and targeted attacks are also determined. Our analytical calculations are supported by numerical simulations.