// if scope node for media query has anything more but whitespaces and rule sets than wrap it with rule set with the same selector group as outer rule set has
if (mediaScopeNode.getChildren().size() > NodeTreeUtils.getChildren(mediaScopeNode, WhiteSpaceCollectionNode.class).size()) {
RuleSetNode newRuleSetNode = new RuleSetNode();
ScopeNode newScopeNode = new ScopeNode();
newRuleSetNode.addChild(selectorGroupNode.clone());
newRuleSetNode.addChild(newScopeNode);
NodeTreeUtils.moveChildren(mediaScopeNode, newScopeNode);
mediaScopeNode.clearChildren();
mediaScopeNode.addChild(newRuleSetNode);